| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 96ed883 commit 65b5ccc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,11 @@ const cp = require('child_process'); | |||
| 3 | 3 | const common = require('../common'); | |
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | ||
| 6 | - const p = cp.spawn('echo'); | ||
| 6 | + // Windows' `echo` command is a built-in shell command and not an external | ||
| 7 | + // executable like on *nix | ||
| 8 | + const opts = { shell: common.isWindows }; | ||
| 9 | + | ||
| 10 | + const p = cp.spawn('echo', [], opts); | ||
| 7 | 11 | ||
| 8 | 12 | p.on('close', common.mustCall(function(code, signal) { | |
| 9 | 13 | assert.strictEqual(code, 0); | |
@@ -15,7 +19,7 @@ p.stdout.read(); | |||
| 15 | 19 | ||
| 16 | 20 | function spawnWithReadable() { | |
| 17 | 21 | const buffer = []; | |
| 18 | - const p = cp.spawn('echo', ['123']); | ||
| 22 | + const p = cp.spawn('echo', ['123'], opts); | ||
| 19 | 23 | p.on('close', common.mustCall(function(code, signal) { | |
| 20 | 24 | assert.strictEqual(code, 0); | |
| 21 | 25 | assert.strictEqual(signal, null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments