Skip to content

Commit a918a25

Browse files
committed
refactor: code → exitCode
1 parent 03228ee commit a918a25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ const extend = defaults => (input, args, options) => {
3737
const stdout = eos(childProcess, 'stdout')
3838
const stderr = eos(childProcess, 'stderr')
3939

40-
childProcess.on('error', reject).on('exit', code => {
40+
childProcess.on('error', reject).on('exit', exitCode => {
4141
Object.defineProperty(childProcess, 'stdout', {
4242
get: parse(stdout, opts)
4343
})
4444
Object.defineProperty(childProcess, 'stderr', { get: parse(stderr) })
45-
if (code === 0) return resolve(childProcess)
45+
if (exitCode === 0) return resolve(childProcess)
4646
const command = `${cmd} ${cmdArgs.join(' ')}`
4747
let message = `The command spawned as:${EOL}${EOL}`
4848
message += ` ${command}${EOL}${EOL}`
49-
message += `exited with \`{ code: ${code} }\` and the following trace:${EOL}${EOL}`
49+
message += `exited with \`{ code: ${exitCode} }\` and the following trace:${EOL}${EOL}`
5050
message += String(stderr)
5151
.split(EOL)
5252
.map(line => ` ${line}`)

0 commit comments

Comments
 (0)