File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { isLinux, isWindows } from '@env/platform';
33
44export { basename , dirname , extname , join as joinPaths } from 'path' ;
55
6- const driveLetterNormalizeRegex = / (?< = ^ \/ ? ) ( [ A - Z ] ) (? = : \/ ) / ;
6+ const driveLetterNormalizeRegex = / ( ^ \/ ? ) ( [ a - z A - Z ] ) (? = : \/ ) / ;
77const hasSchemeRegex = / ^ ( [ a - z A - Z ] [ \w + . - ] + ) : / ;
88const pathNormalizeRegex = / \\ / g;
99const slash = 47 ;
@@ -71,8 +71,8 @@ export function normalizePath(path: string): string {
7171 }
7272
7373 if ( isWindows ) {
74- // Ensure that drive casing is normalized (lower case)
75- path = path . replace ( driveLetterNormalizeRegex , d => d . toLowerCase ( ) ) ;
74+ // Ensure that drive casing is normalized (lower case) and no leading slash
75+ path = path . replace ( driveLetterNormalizeRegex , ( _ , _slash , d : string ) => d . toLowerCase ( ) ) ;
7676 }
7777
7878 return path ;
You can’t perform that action at this time.
0 commit comments