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 317
317
}
318
318
319
319
function tryGetCwd ( path ) {
320
- var threw = true ;
321
- var cwd ;
322
320
try {
323
- cwd = process . cwd ( ) ;
324
- threw = false ;
325
- } finally {
326
- if ( threw ) {
327
- // getcwd(3) can fail if the current working directory has been deleted.
328
- // Fall back to the directory name of the (absolute) executable path.
329
- // It's not really correct but what are the alternatives?
330
- return path . dirname ( process . execPath ) ;
331
- }
321
+ return process . cwd ( ) ;
322
+ } catch ( ex ) {
323
+ // getcwd(3) can fail if the current working directory has been deleted.
324
+ // Fall back to the directory name of the (absolute) executable path.
325
+ // It's not really correct but what are the alternatives?
326
+ return path . dirname ( process . execPath ) ;
332
327
}
333
- return cwd ;
334
328
}
335
329
336
330
function evalScript ( name ) {
You can’t perform that action at this time.
0 commit comments