promisifyChildProcess(spawn) {
    return new Promise((resolve, reject) => {
      spawn.addListener('error', reject);
      spawn.addListener('exit', (code) => {
        const message = `Child process exited with code ${code}`;
        return (code === 0) ? resolve(message) : reject(message);
      });
      spawn.stdout.on('data', (data) => {
        this.logger.info(data.toString());
      });
      spawn.stderr.on('data', (data) => {
        this.logger.error(data.toString());
      });
      spawn.on('error', (err) => {
        this.logger.error('Failed to start subprocess.');
      });
    });
  }
/**
   * Encapsulates child processes in Promises
   *
   * @abstract
   * @param {module:child_process} spawn Child Process to be executed
   * @return {Promise} Returns promise with child process results
   */
Encapsulates child processes in Promises
@abstract
@param {module:child_process} spawn Child Process to be executed
@return {Promise} Returns promise with child process results
Encapsulates child processes in Promises @abstract @param { module : child_process } spawn Child Process to be executed @return { Promise } Returns promise with child process results
promisifyChildProcess(spawn) {
    return new Promise((resolve, reject) => {
      spawn.addListener('error', reject);
      spawn.addListener('exit', (code) => {
        const message = `Child process exited with code ${code}`;
        return (code === 0) ? resolve(message) : reject(message);
      });
      spawn.stdout.on('data', (data) => {
        this.logger.info(data.toString());
      });
      spawn.stderr.on('data', (data) => {
        this.logger.error(data.toString());
      });
      spawn.on('error', (err) => {
        this.logger.error('Failed to start subprocess.');
      });
    });
  }
promisifyChildProcess ( spawn ) { return new Promise ( ( resolve , reject ) => { spawn . addListener ( 'error' , reject ) ; spawn . addListener ( 'exit' , ( code ) => { const message = ` ${ code } ` ; return ( code === 0 ) ? resolve ( message ) : reject ( message ) ; } ) ; spawn . stdout . on ( 'data' , ( data ) => { this . logger . info ( data . toString ( ) ) ; } ) ; spawn . stderr . on ( 'data' , ( data ) => { this . logger . error ( data . toString ( ) ) ; } ) ; spawn . on ( 'error' , ( err ) => { this . logger . error ( 'Failed to start subprocess.' ) ; } ) ; } ) ; }
Encapsulates child processes in Promises
 @abstract
 @param {module:child_process} spawn Child Process to be executed
 @return {Promise} Returns promise with child process results
Encapsulates child processes in Promises @abstract @param { module : child_process } spawn Child Process to be executed @return { Promise } Returns promise with child process results