lib/pip.js
function mergeCommands(commands) {
  const cmds = filterCommands(commands);
  if (cmds.length === 0) {
    throw new Error('Expected at least one non-empty command');
  } else if (cmds.length === 1) {
    return cmds[0];
  } else {
    // Quote the arguments in each command and join them all using &&.
    const script = cmds.map(quote).join(' && ');
    return ['/bin/sh', '-c', script];
  }
}
function mergeCommands(commands) {
  const cmds = filterCommands(commands);
  if (cmds.length === 0) {
    throw new Error('Expected at least one non-empty command');
  } else if (cmds.length === 1) {
    return cmds[0];
  } else {
    // Quote the arguments in each command and join them all using &&.
    const script = cmds.map(quote).join(' && ');
    return ['/bin/sh', '-c', script];
  }
}
function mergeCommands ( commands ) { const cmds = filterCommands ( commands ) ; if ( cmds . length === 0 ) { throw new Error ( 'Expected at least one non-empty command' ) ; } else if ( cmds . length === 1 ) { return cmds [ 0 ] ; } else { // Quote the arguments in each command and join them all using &&. const script = cmds . map ( quote ) . join ( ' && ' ) ; return [ '/bin/sh' , '-c' , script ] ; } }
Render zero or more commands as a single command for a Unix environment.
In this context, a "command" is a list of arguments. An empty list or falsy value is ommitted.

@param {string[][]} many commands to merge.
@return {string[]} a single list of words.
Render zero or more commands as a single command for a Unix environment . In this context a command is a list of arguments . An empty list or falsy value is ommitted .