Permalink
Browse files

Stop trying to `spawn` non-exe's on Windows.

  • Loading branch information...
1 parent efd300b commit 1ba6a7f2692ba417ea7d603e6cfa7c0bfc0152c9 @domenic domenic committed Oct 29, 2012
Showing with 6 additions and 9 deletions.
  1. +3 −5 test/packages/npm-test-array-bin/test.js
  2. +3 −4 test/packages/npm-test-dir-bin/test.js
@@ -1,6 +1,4 @@
-var c = require('child_process').spawn('array-bin', [], {
- env: process.env }).on('close', function (code) {
- if (code) throw new Error('exited badly with code = ' + code)
+require('child_process').exec('array-bin', { env: process.env },
+ function (err) {
+ if (err && err.code) throw new Error('exited badly with code = ' + err.code)
})
-c.stdout.pipe(process.stdout)
-c.stderr.pipe(process.stderr)
@@ -1,5 +1,4 @@
-require('child_process').spawn('dir-bin', [], {
- env: process.env }).on('exit', function (code) {
- if (code) throw new Error('exited badly with code = ' + code)
+require('child_process').exec('dir-bin', { stdio: 'pipe',
+ env: process.env }, function (err) {
+ if (err && err.code) throw new Error('exited badly with code = ' + err.code)
})
-

0 comments on commit 1ba6a7f

Please sign in to comment.