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 466
466
}
467
467
468
468
function tryGetCwd ( path ) {
469
- var threw = true ;
470
- var cwd ;
471
469
try {
472
- cwd = process . cwd ( ) ;
473
- threw = false ;
474
- } finally {
475
- if ( threw ) {
476
- // getcwd(3) can fail if the current working directory has been deleted.
477
- // Fall back to the directory name of the (absolute) executable path.
478
- // It's not really correct but what are the alternatives?
479
- return path . dirname ( process . execPath ) ;
480
- }
470
+ return process . cwd ( ) ;
471
+ } catch ( ex ) {
472
+ // getcwd(3) can fail if the current working directory has been deleted.
473
+ // Fall back to the directory name of the (absolute) executable path.
474
+ // It's not really correct but what are the alternatives?
475
+ return path . dirname ( process . execPath ) ;
481
476
}
482
- return cwd ;
483
477
}
484
478
485
479
function evalScript ( name ) {
You can’t perform that action at this time.
0 commit comments