Remove only trailing slashes (#3183)

This commit is contained in:
tomonacci
2026-01-05 13:42:10 -05:00
committed by GitHub
parent 862e717ff7
commit 1ae217d74d
2 changed files with 7 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ export function normalizePath(p: string): string {
if (isUnixPath) {
// For Unix paths, just normalize without converting to Windows format
// Replace double slashes with single slashes and remove trailing slashes
return p.replace(/\/+/g, '/').replace(/\/+$/, '');
return p.replace(/\/+/g, '/').replace(/(?<!^)\/$/, '');
}
// Convert Unix-style Windows paths (/c/, /d/) to Windows format if on Windows