Skip to content
Myr

Turn off echo on Windows - fixes #116 (#118)

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

authored by Sam Verschueren · committed by Sindre Sorhus · parent 5f890ab · Browse files · 3 files+15 added−0 removed
This commit

State

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

Diff stats

3 files+15 added−0 removed

  • other:+15 added−0 removed

3 files+15 added−0 removed

added:fixtures/hello.cmd+1 added
1ECHO Hello World
modified:index.js+6 added
1'use strict';2const path = require('path');3const childProcess = require('child_process');4const util = require('util');5const crossSpawn = require('cross-spawn');6const stripEof = require('strip-eof');
52 unmodified lines
59 // #11560 opts.cleanup = false;61 }6263 if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {64 // #11665 parsed.args.unshift('/q');66 }6768 return {69 cmd: parsed.command,70 args: parsed.args,71 opts,
292 unmodified lines
modified:test.js+8 added
15 unmodified lines
16 const {stdout} = await m('noop', ['foo']);17 t.is(stdout, 'foo');18});1920if (process.platform === 'win32') {21 test('execa() - cmd file', async t => {22 const {stdout} = await m('hello.cmd');2324 t.is(stdout, 'Hello World');25 });26}2728test('buffer', async t => {29 const {stdout} = await m('noop', ['foo'], {encoding: null});30 t.true(Buffer.isBuffer(stdout));31 t.is(stdout.toString(), 'foo');
478 unmodified lines