lib/utils.js
function executeChildProcess (fileName, args, options) {
  return new Promise((resolve, reject) => {
    const child = require('child_process').spawn(fileName, args, options)

    child.stdout.on('data', (data) => log(data.toString()))
    child.stderr.on('data', (data) => log(data.toString()))

    child.on('exit', (code) => {
      if (code !== 0) {
        return reject(new Error(fileName + ' exited with code: ' + code))
      }
      return resolve()
    })

    child.stdin.end()
  })
}
function executeChildProcess (fileName, args, options) {
  return new Promise((resolve, reject) => {
    const child = require('child_process').spawn(fileName, args, options)

    child.stdout.on('data', (data) => log(data.toString()))
    child.stderr.on('data', (data) => log(data.toString()))

    child.on('exit', (code) => {
      if (code !== 0) {
        return reject(new Error(fileName + ' exited with code: ' + code))
      }
      return resolve()
    })

    child.stdin.end()
  })
}
function executeChildProcess ( fileName , args , options ) { return new Promise ( ( resolve , reject ) => { const child = require ( 'child_process' ) . spawn ( fileName , args , options ) child . stdout . on ( 'data' , ( data ) => log ( data . toString ( ) ) ) child . stderr . on ( 'data' , ( data ) => log ( data . toString ( ) ) ) child . on ( 'exit' , ( code ) => { if ( code !== 0 ) { return reject ( new Error ( fileName + ' exited with code: ' + code ) ) } return resolve ( ) } ) child . stdin . end ( ) } ) }
Starts a child process using the provided executable

@param fileName      - Path to the executable to start
@param args          - Arguments for spawn
@param options       - Options passed to spawn
@returns {Promise}   - A promise that resolves when the
process exits
Starts a child process using the provided executable