lib/environment.js
function splitArgsFromString(argsString) {
  let result = [];
  const quoteSeparatedArgs = argsString.split(/(\x22[^\x22]*\x22)/).filter(x => x);
  quoteSeparatedArgs.forEach(arg => {
    if (arg.match('\x22')) {
      result.push(arg.replace(/\x22/g, ''));
    } else {
      result = result.concat(arg.trim().split(' '));
    }
  });
  return result;
}
function splitArgsFromString(argsString) {
  let result = [];
  const quoteSeparatedArgs = argsString.split(/(\x22[^\x22]*\x22)/).filter(x => x);
  quoteSeparatedArgs.forEach(arg => {
    if (arg.match('\x22')) {
      result.push(arg.replace(/\x22/g, ''));
    } else {
      result = result.concat(arg.trim().split(' '));
    }
  });
  return result;
}
function splitArgsFromString ( argsString ) { let result = [ ] ; const quoteSeparatedArgs = argsString . split ( / (\x22[^\x22]*\x22) / ) . filter ( x => x ) ; quoteSeparatedArgs . forEach ( arg => { if ( arg . match ( '\x22' ) ) { result . push ( arg . replace ( / \x22 / g , '' ) ) ; } else { result = result . concat ( arg . trim ( ) . split ( ' ' ) ) ; } } ) ; return result ; }
Two-step argument splitting function that first splits arguments in quotes,
and then splits up the remaining arguments if they are not part of a quote.
Two - step argument splitting function that first splits arguments in quotes and then splits up the remaining arguments if they are not part of a quote .