@@ -37,7 +37,7 @@ function execSync(cmd, opts, pipe) {
3737 var previousStderrContent = '' ;
3838 // Echoes stdout and stderr changes from running process, if not silent
3939 function updateStream ( streamFile ) {
40- if ( opts . silent || ! common . existsSync ( streamFile ) ) {
40+ if ( opts . silent || ! fs . existsSync ( streamFile ) ) {
4141 return ;
4242 }
4343
@@ -61,10 +61,10 @@ function execSync(cmd, opts, pipe) {
6161 previousStreamContent = streamContent ;
6262 }
6363
64- if ( common . existsSync ( scriptFile ) ) common . unlinkSync ( scriptFile ) ;
65- if ( common . existsSync ( stdoutFile ) ) common . unlinkSync ( stdoutFile ) ;
66- if ( common . existsSync ( stderrFile ) ) common . unlinkSync ( stderrFile ) ;
67- if ( common . existsSync ( codeFile ) ) common . unlinkSync ( codeFile ) ;
64+ if ( fs . existsSync ( scriptFile ) ) common . unlinkSync ( scriptFile ) ;
65+ if ( fs . existsSync ( stdoutFile ) ) common . unlinkSync ( stdoutFile ) ;
66+ if ( fs . existsSync ( stderrFile ) ) common . unlinkSync ( stderrFile ) ;
67+ if ( fs . existsSync ( codeFile ) ) common . unlinkSync ( codeFile ) ;
6868
6969 var execCommand = JSON . stringify ( process . execPath ) + ' ' + JSON . stringify ( scriptFile ) ;
7070 var script ;
@@ -134,9 +134,9 @@ function execSync(cmd, opts, pipe) {
134134 // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage
135135 // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing
136136 // CPU usage, though apparently not so much on Windows)
137- while ( ! common . existsSync ( codeFile ) ) { updateStream ( stdoutFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
138- while ( ! common . existsSync ( stdoutFile ) ) { updateStream ( stdoutFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
139- while ( ! common . existsSync ( stderrFile ) ) { updateStream ( stderrFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
137+ while ( ! fs . existsSync ( codeFile ) ) { updateStream ( stdoutFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
138+ while ( ! fs . existsSync ( stdoutFile ) ) { updateStream ( stdoutFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
139+ while ( ! fs . existsSync ( stderrFile ) ) { updateStream ( stderrFile ) ; fs . writeFileSync ( sleepFile , 'a' ) ; }
140140 try { common . unlinkSync ( sleepFile ) ; } catch ( e ) { }
141141 }
142142
0 commit comments