Skip to content
Myr

Add `/q` option to `cmd` as well as `cmd.exe` on Windows (#203)

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

authored by Guillaume Martigny · committed by Sindre Sorhus · parent 136b340 · Browse files · 2 files+6 added−1 removed
This commit

State

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

Diff stats

2 files+6 added−1 removed

  • other:+6 added−1 removed

2 files+6 added−1 removed

modified:index.js+1 added-1 removed
58 unmodified lines
59 // #11560 options.cleanup = false;61 }6263 if (process.platform === 'win32' && path.basename(command) === 'cmd.exe') {63 if (process.platform === 'win32' && path.basename(command, '.exe') === 'cmd') {64 // #11665 args.unshift('/q');66 }67
393 unmodified lines
modified:test.js+5 added
26 unmodified lines
27 test('execa() - cmd file', async t => {28 const {stdout} = await execa('hello.cmd');29 t.is(stdout, 'Hello World');30 });3132 test('execa() - run cmd command', async t => {33 const {stdout} = await execa('cmd', ['/c', 'hello.cmd']);34 t.is(stdout, 'Hello World');35 });36}3738test('buffer', async t => {39 const {stdout} = await execa('noop', ['foo'], {encoding: null});
621 unmodified lines