lib/docker.js
function dockerCommand(options) {
  const cmd = 'docker';
  const ps = spawnSync(cmd, options, { encoding: 'utf-8' });
  if (ps.error) {
    if (ps.error.code === 'ENOENT') {
      throw new Error('docker not found! Please install it.');
    }
    throw new Error(ps.error);
  } else if (ps.status !== 0) {
    throw new Error(ps.stderr);
  }
  return ps;
}
function dockerCommand(options) {
  const cmd = 'docker';
  const ps = spawnSync(cmd, options, { encoding: 'utf-8' });
  if (ps.error) {
    if (ps.error.code === 'ENOENT') {
      throw new Error('docker not found! Please install it.');
    }
    throw new Error(ps.error);
  } else if (ps.status !== 0) {
    throw new Error(ps.stderr);
  }
  return ps;
}
function dockerCommand ( options ) { const cmd = 'docker' ; const ps = spawnSync ( cmd , options , { encoding : 'utf-8' } ) ; if ( ps . error ) { if ( ps . error . code === 'ENOENT' ) { throw new Error ( 'docker not found! Please install it.' ) ; } throw new Error ( ps . error ) ; } else if ( ps . status !== 0 ) { throw new Error ( ps . stderr ) ; } return ps ; }
Helper function to run a docker command
@param {string[]} options
@return {Object}
Helper function to run a docker command