Rename `joinedCommand` variables to `command` (#278)
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 7260fcf · Browse files · 1 file·+10 added−10 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+10 added−10 removed
- other:+10 added−10 removed
Provenance
- Commit
50a924a- Tree
d0cdb60- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
Sindre Sorhus <sindresorhus@gmail.com>- Parent
7260fcf
1 file changed+10 added−10 removed
modified:index.js+10 added-10 removed
136 unmodified lines137 138 function makeError(result, options) {139 const {stdout, stderr, signal} = result;140 let {error} = result;141- const {code, joinedCommand, timedOut, isCanceled, killed, parsed: {options: {timeout}}} = options;141+ const {code, command, timedOut, isCanceled, killed, parsed: {options: {timeout}}} = options;142 143 const [exitCodeName, exitCode] = getCode(result, code);144 145 const prefix = getErrorPrefix({timedOut, timeout, signal, exitCodeName, exitCode, isCanceled});146- const message = `Command ${prefix}: ${joinedCommand}`;146+ const message = `Command ${prefix}: ${command}`;147 148 if (error instanceof Error) {149 error.message = `${message}\n${error.message}`;150 } else {151 error = new Error(message);152 }153 154- error.command = joinedCommand;154+ error.command = command;155 delete error.code;156 error.exitCode = exitCode;157 error.exitCodeName = exitCodeName;158 error.stdout = stdout;81 unmodified lines240 241 const execa = (file, args, options) => {242 const parsed = handleArgs(file, args, options);243 const {encoding, buffer, maxBuffer} = parsed.options;244- const joinedCommand = joinCommand(file, args);244+ const command = joinCommand(file, args);245 246 let spawned;247 try {248 spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);249 } catch (error) {250 return Promise.reject(makeError({error, stdout: '', stderr: '', all: ''}, {251- joinedCommand,251+ command,252 parsed,253 timedOut: false,254 isCanceled: false,255 killed: false93 unmodified lines349 350 if (result.error || result.code !== 0 || result.signal !== null) {351 const error = makeError(result, {352 code: result.code,353- joinedCommand,353+ command,354 parsed,355 timedOut,356 isCanceled,357 killed: spawned.killed6 unmodified lines364 throw error;365 }366 367 return {368- command: joinedCommand,368+ command,369 exitCode: 0,370 exitCodeName: 'SUCCESS',371 stdout: result.stdout,372 stderr: result.stderr,35 unmodified lines408 module.exports = execa;409 410 module.exports.sync = (file, args, options) => {411 const parsed = handleArgs(file, args, options);412- const joinedCommand = joinCommand(file, args);412+ const command = joinCommand(file, args);413 414 if (isStream(parsed.options.input)) {415 throw new TypeError('The `input` option cannot be a stream in sync mode');416 }4 unmodified lines421 422 if (result.error || result.status !== 0 || result.signal !== null) {423 const error = makeError(result, {424 code: result.status,425- joinedCommand,425+ command,426 parsed,427 timedOut: result.error && result.error.errno === 'ETIMEDOUT',428 isCanceled: false,429 killed: result.signal !== null6 unmodified lines436 throw error;437 }438 439 return {440- command: joinedCommand,440+ command,441 exitCode: 0,442 exitCodeName: 'SUCCESS',443 stdout: result.stdout,444 stderr: result.stderr,38 unmodified lines