File tree 1 file changed +6
-12
lines changed
1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 430
430
}
431
431
432
432
function tryGetCwd ( path ) {
433
- var threw = true ;
434
- var cwd ;
435
433
try {
436
- cwd = process . cwd ( ) ;
437
- threw = false ;
438
- } finally {
439
- if ( threw ) {
440
- // getcwd(3) can fail if the current working directory has been deleted.
441
- // Fall back to the directory name of the (absolute) executable path.
442
- // It's not really correct but what are the alternatives?
443
- return path . dirname ( process . execPath ) ;
444
- }
434
+ return process . cwd ( ) ;
435
+ } catch ( ex ) {
436
+ // getcwd(3) can fail if the current working directory has been deleted.
437
+ // Fall back to the directory name of the (absolute) executable path.
438
+ // It's not really correct but what are the alternatives?
439
+ return path . dirname ( process . execPath ) ;
445
440
}
446
- return cwd ;
447
441
}
448
442
449
443
function evalScript ( name ) {
You can’t perform that action at this time.
0 commit comments