Skip to content
Myr

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

5 files+17 added−17 removed

modified:index.d.ts+3 added-3 removed
219 unmodified lines
220221 /**222 The command that was run.223 */224 cmd: string;224 command: string;225226 /**227 Whether the process timed out.228 */
189 unmodified lines
418 // 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 lines
475 // exitCodeName: 'ESRCH',476 // stdout: '',477 // stderr: '',478 // failed: true,479 // cmd: 'exit 3',479 // command: 'exit 3',480 // timedOut: false481 //}482 }483 ```
9 unmodified lines
modified:index.js+3 added-3 removed
162 unmodified lines
163 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;170171 if ('all' in result) {
168 unmodified lines
340 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 lines
421 code: 0,422 exitCode: 0,423 exitCodeName: 'SUCCESS',424 failed: false,425 cmd: joinedCommand,425 command: joinedCommand,426 timedOut: false427 };428};429
1 unmodified line
modified:index.test-d.ts+2 added-2 removed
modified:readme.md+2 added-2 removed
65 unmodified lines
66 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 lines
100 exitCodeName: 'ESRCH',101 stdout: '',102 stderr: '',103 failed: true,104 cmd: 'exit 3',104 command: 'exit 3',105 timedOut: false106 }107 */108}
245 unmodified lines
modified:test.js+7 added-7 removed
414 unmodified lines
415416test(errorMessage, /Command failed with exit code 2.*: exit 2 foo bar/, 2, 'foo', 'bar');417test(errorMessage, /Command failed with exit code 3.*: exit 3 baz quz/, 3, 'baz', 'quz');418419async function cmd(t, expected, ...args) {419async 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}`);422423 const result = await execa('noop', args);424 t.is(result.cmd, `noop${expected}`);424 t.is(result.command, `noop${expected}`);425}426427cmd.title = (message, expected) => `cmd is: ${JSON.stringify(expected)}`;427command.title = (message, expected) => `command is: ${JSON.stringify(expected)}`;428429test(cmd, ' foo bar', 'foo', 'bar');430test(cmd, ' baz quz', 'baz', 'quz');431test(cmd, '');429test(command, ' foo bar', 'foo', 'bar');430test(command, ' baz quz', 'baz', 'quz');431test(command, '');432433async function spawnAndKill(t, signal, cleanup) {434 const name = cleanup ? 'sub-process' : 'sub-process-false';435 const cp = execa(name);
207 unmodified lines