File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1192,8 +1192,8 @@ const posix = {
1192
1192
let resolvedAbsolute = false ;
1193
1193
let slashCheck = false ;
1194
1194
1195
- for ( let i = args . length - 1 ; i >= - 1 && ! resolvedAbsolute ; i -- ) {
1196
- const path = i >= 0 ? args [ i ] : posixCwd ( ) ;
1195
+ for ( let i = args . length - 1 ; i >= 0 && ! resolvedAbsolute ; i -- ) {
1196
+ const path = args [ i ] ;
1197
1197
validateString ( path , `paths[${ i } ]` ) ;
1198
1198
1199
1199
// Skip empty entries
@@ -1215,6 +1215,13 @@ const posix = {
1215
1215
StringPrototypeCharCodeAt ( path , 0 ) === CHAR_FORWARD_SLASH ;
1216
1216
}
1217
1217
1218
+ if ( ! resolvedAbsolute ) {
1219
+ const cwd = posixCwd ( ) ;
1220
+ resolvedPath = `${ cwd } /${ resolvedPath } ` ;
1221
+ resolvedAbsolute =
1222
+ StringPrototypeCharCodeAt ( cwd , 0 ) === CHAR_FORWARD_SLASH ;
1223
+ }
1224
+
1218
1225
// At this point the path should be resolved to a full absolute path, but
1219
1226
// handle relative paths to be safe (might happen when process.cwd() fails)
1220
1227
You can’t perform that action at this time.
0 commit comments