@@ -4,6 +4,7 @@ var request = require('teeny-request').teenyRequest
44var urlgrey = require ( 'urlgrey' )
55var jsYaml = require ( 'js-yaml' )
66var walk = require ( 'ignore-walk' )
7+ var execFileSync = require ( 'child_process' ) . execFileSync
78var execSync = require ( 'child_process' ) . execSync
89
910var detectProvider = require ( './detect' )
@@ -355,7 +356,7 @@ var upload = function(args, on_success, on_failure) {
355356 console . log ( '==> Building file structure' )
356357 try {
357358 upload +=
358- execSync ( 'git ls-files || hg locate' , { cwd : root } )
359+ execFileSync ( 'git' , [ ' ls-files' , '||' , 'hg' , ' locate'] , { cwd : root } )
359360 . toString ( )
360361 . trim ( ) + '\n<<<<<< network\n'
361362 } catch ( err ) {
@@ -414,7 +415,7 @@ var upload = function(args, on_success, on_failure) {
414415 }
415416 debug . push ( gcov )
416417 console . log ( ' $ ' + gcov )
417- execSync ( gcov )
418+ execFileSync ( gcov )
418419 } catch ( e ) {
419420 console . log ( ' Failed to run gcov command.' )
420421 }
@@ -431,7 +432,9 @@ var upload = function(args, on_success, on_failure) {
431432 . toString ( )
432433 . trim ( )
433434 } else {
434- bowerrc = execSync ( 'if exist .bowerrc type .bowerrc' , { cwd : root } )
435+ bowerrc = execFileSync ( 'if' , [ 'exist' , '.bowerrc' , 'type' , '.bowerrc' ] , {
436+ cwd : root ,
437+ } )
435438 . toString ( )
436439 . trim ( )
437440 }
@@ -475,14 +478,16 @@ var upload = function(args, on_success, on_failure) {
475478 console . log ( '==> Scanning for reports' )
476479 var _files
477480 if ( ! isWindows ) {
478- _files = execSync ( 'find ' + root + ' ' + patterns + more_patterns )
481+ // @TODO support for a root directory
482+ // It's not straightforward due to the nature of the find command
483+ _files = execFileSync ( 'find' , [ root , patterns , more_patterns ] )
479484 . toString ( )
480485 . trim ( )
481486 . split ( '\n' )
482487 } else {
483488 // @TODO support for a root directory
484489 // It's not straightforward due to the nature of the dir command
485- _files = execSync ( 'dir ' + patterns + more_patterns )
490+ _files = execFileSync ( 'dir' , [ patterns , more_patterns ] )
486491 . toString ( )
487492 . trim ( )
488493 . split ( '\r\n' )
0 commit comments