Skip to content
Myr

Refactor entry point of `execa.node()` (#305)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by Sindre Sorhus · parent 0d4a97a · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:index.js+5 added-4 removed
521 unmodified lines
522 const [file, ...args] = parseCommand(command);523 return execa.sync(file, args, options);524};525526module.exports.node = (scriptPath, args, options) => {526module.exports.node = (scriptPath, args, options = {}) => {527 if (args && !Array.isArray(args) && typeof args === 'object') {528 options = args;529 args = [];530 }531532 const stdioOption = stdio.node(options);533 options = options || {};533534 const {nodePath = process.execPath, nodeArguments = process.execArgv} = options;535536 return execa(536 options.nodePath || process.execPath,537 nodePath,538 [538 ...(options.nodeArguments || process.execArgv),539 ...nodeArguments,540 scriptPath,541 ...(Array.isArray(args) ? args : [])542 ],543 {
9 unmodified lines