index.js
function run(cmd, args, options) {
  if (process.env.SLS_DEBUG) console.log('Running', cmd, args.join(' '));

  const stdio = process.env.SLS_DEBUG && options && options.showOutput
    ? ['pipe', 'inherit', 'pipe'] : 'pipe';
  const ps = child_process.spawnSync(cmd, args, {encoding: 'utf-8', 'stdio': stdio});
  if (ps.error) {
    if (ps.error.code === 'ENOENT') {
      throw new Error(`${cmd} not found! Please install it.`);
    }
    throw new Error(ps.error);
  } else if (ps.status !== 0) {
    throw new Error(ps.stderr);
  }
  return ps;
}
function run(cmd, args, options) {
  if (process.env.SLS_DEBUG) console.log('Running', cmd, args.join(' '));

  const stdio = process.env.SLS_DEBUG && options && options.showOutput
    ? ['pipe', 'inherit', 'pipe'] : 'pipe';
  const ps = child_process.spawnSync(cmd, args, {encoding: 'utf-8', 'stdio': stdio});
  if (ps.error) {
    if (ps.error.code === 'ENOENT') {
      throw new Error(`${cmd} not found! Please install it.`);
    }
    throw new Error(ps.error);
  } else if (ps.status !== 0) {
    throw new Error(ps.stderr);
  }
  return ps;
}
function run ( cmd , args , options ) { if ( process . env . SLS_DEBUG ) console . log ( 'Running' , cmd , args . join ( ' ' ) ) ; const stdio = process . env . SLS_DEBUG && options && options . showOutput ? [ 'pipe' , 'inherit' , 'pipe' ] : 'pipe' ; const ps = child_process . spawnSync ( cmd , args , { encoding : 'utf-8' , 'stdio' : stdio } ) ; if ( ps . error ) { if ( ps . error . code === 'ENOENT' ) { throw new Error ( ` ${ cmd } ` ) ; } throw new Error ( ps . error ) ; } else if ( ps . status !== 0 ) { throw new Error ( ps . stderr ) ; } return ps ; }
Helper function to run commands
Helper function to run commands