Rename `.cmd` to `.command` (#194)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fixes #190
authored by Satya Rohith · committed by Sindre Sorhus · parent f2cb86f · Browse files · 5 files·+17 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+17 added−17 removed
- other:+17 added−17 removed
Provenance
- Commit
95c8a14- Tree
984ef1d- Author
Satya Rohith <gsatyarohith@gmail.com>- Committer
Sindre Sorhus <sindresorhus@gmail.com>- Parent
f2cb86f
5 files changed+17 added−17 removed
modified:index.d.ts+3 added-3 removed
219 unmodified lines220 221 /**222 The command that was run.223 */224- cmd: string;224+ command: string;225 226 /**227 Whether the process timed out.228 */189 unmodified lines418 // stdout: '',419 // stderr: '',420 // all: '',421 // failed: true,422- // cmd: 'exit 3',422+ // command: 'exit 3',423 // timedOut: false,424 // killed: false425 //}426 }48 unmodified lines475 // exitCodeName: 'ESRCH',476 // stdout: '',477 // stderr: '',478 // failed: true,479- // cmd: 'exit 3',479+ // command: 'exit 3',480 // timedOut: false481 //}482 }483 ```9 unmodified linesmodified:index.js+3 added-3 removed
162 unmodified lines163 error.failed = true;164 // `signal` emitted on `spawned.on('exit')` event can be `null`. We normalize165 // it to `undefined`166 error.signal = signal || undefined;167- error.cmd = joinedCommand;167+ error.command = joinedCommand;168 error.timedOut = Boolean(timedOut);169 error.isCanceled = isCanceled;170 171 if ('all' in result) {168 unmodified lines340 exitCode: 0,341 exitCodeName: 'SUCCESS',342 failed: false,343 killed: false,344- cmd: joinedCommand,344+ command: joinedCommand,345 timedOut: false,346 isCanceled: false347 };348 }), destroy);72 unmodified lines421 code: 0,422 exitCode: 0,423 exitCodeName: 'SUCCESS',424 failed: false,425- cmd: joinedCommand,425+ command: joinedCommand,426 timedOut: false427 };428 };429 1 unmodified linemodified:index.test-d.ts+2 added-2 removed
10 unmodified lines1112131415151617181912 unmodified lines32333435363637383940122 unmodified linesExpand all10 unmodified lines const execaPromise = execa('unicorns'); execaPromise.cancel();
const unicornsResult = await execaPromise; expectType<string>(unicornsResult.cmd); expectType<string>(unicornsResult.command); expectType<string | number>(unicornsResult.code); expectType<boolean>(unicornsResult.failed); expectType<boolean>(unicornsResult.killed); expectType<string | undefined>(unicornsResult.signal);12 unmodified lines}
try { const unicornsResult = execa.sync('unicorns'); expectType<string>(unicornsResult.cmd); expectType<string>(unicornsResult.command); expectType<string | number>(unicornsResult.code); expectType<boolean>(unicornsResult.failed); expectType<boolean>(unicornsResult.killed); expectType<string | undefined>(unicornsResult.signal);122 unmodified linesExpand allmodified:readme.md+2 added-2 removed
65 unmodified lines66 stdout: '',67 stderr: '',68 all: '',69 failed: true,70- cmd: 'exit 3',70+ command: 'exit 3',71 timedOut: false,72 killed: false73 }74 */25 unmodified lines100 exitCodeName: 'ESRCH',101 stdout: '',102 stderr: '',103 failed: true,104- cmd: 'exit 3',104+ command: 'exit 3',105 timedOut: false106 }107 */108 }245 unmodified linesmodified:test.js+7 added-7 removed
414 unmodified lines415 416 test(errorMessage, /Command failed with exit code 2.*: exit 2 foo bar/, 2, 'foo', 'bar');417 test(errorMessage, /Command failed with exit code 3.*: exit 3 baz quz/, 3, 'baz', 'quz');418 419-async function cmd(t, expected, ...args) {419+async function command(t, expected, ...args) {420 const error = await t.throwsAsync(execa('fail', args));421- t.is(error.cmd, `fail${expected}`);421+ t.is(error.command, `fail${expected}`);422 423 const result = await execa('noop', args);424- t.is(result.cmd, `noop${expected}`);424+ t.is(result.command, `noop${expected}`);425 }426 427-cmd.title = (message, expected) => `cmd is: ${JSON.stringify(expected)}`;427+command.title = (message, expected) => `command is: ${JSON.stringify(expected)}`;428 429-test(cmd, ' foo bar', 'foo', 'bar');430-test(cmd, ' baz quz', 'baz', 'quz');431-test(cmd, '');429+test(command, ' foo bar', 'foo', 'bar');430+test(command, ' baz quz', 'baz', 'quz');431+test(command, '');432 433 async function spawnAndKill(t, signal, cleanup) {434 const name = cleanup ? 'sub-process' : 'sub-process-false';435 const cp = execa(name);207 unmodified lines