Fix harness crash (#25266)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
renuka16032007
2026-04-15 22:55:15 +05:30
committed by GitHub
parent 55620235c0
commit c68efece74
+8 -1
View File
@@ -17,5 +17,12 @@ export function resolvePath(p: string): string {
} else if (p === '~' || p.startsWith('~/')) {
expandedPath = homedir() + p.substring(1);
}
return path.normalize(expandedPath);
try {
return path.normalize(expandedPath);
} catch (err: unknown) {
if (err instanceof Error && 'code' in err && err.code === 'ENAMETOOLONG') {
return expandedPath;
}
throw err;
}
}