blob: a8af6e4715e80cc106d2ba0c6cc7365586b3585a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/usr/bin/env node
var sw = require('../..')
sw([require.resolve('./test-shim.js')])
var path = require('path')
var spawn = require('child_process').spawn
spawn(path.resolve(process.argv[2]), process.argv.slice(3), {
stdio: 'inherit'
}).on('close', function (code, signal) {
if (code || signal) {
throw new Error('failed with ' + (code || signal))
}
// now run using PATH
process.env.PATH = path.resolve(path.dirname(process.argv[2])) +
':' + process.env.PATH
spawn(path.basename(process.argv[2]), process.argv.slice(3), {
stdio: 'inherit',
}, function (code, signal) {
if (code || signal) {
throw new Error('failed with ' + (code || signal))
}
})
})
|