aboutsummaryrefslogtreecommitdiff
path: root/node_modules/spawn-wrap/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/spawn-wrap/index.js')
-rw-r--r--node_modules/spawn-wrap/index.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/node_modules/spawn-wrap/index.js b/node_modules/spawn-wrap/index.js
index a64995bbf..30a2d32e7 100644
--- a/node_modules/spawn-wrap/index.js
+++ b/node_modules/spawn-wrap/index.js
@@ -11,7 +11,8 @@ var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var path = require('path')
var signalExit = require('signal-exit')
-var homedir = require('os-homedir')() + '/.node-spawn-wrap-'
+var home = process.env.SPAWN_WRAP_SHIM_ROOT || require('os-homedir')()
+var homedir = home + '/.node-spawn-wrap-'
var which = require('which')
var util = require('util')
@@ -23,7 +24,10 @@ var debug = doDebug ? function () {
process.stderr.write(message + '\n')
} : function () {}
-var shim = '#!' + process.execPath + '\n' +
+var shebang = process.platform === 'os390' ?
+ '#!/bin/env ' : '#!'
+
+var shim = shebang + process.execPath + '\n' +
fs.readFileSync(__dirname + '/shim.js')
var isWindows = require('./lib/is-windows')()
@@ -37,7 +41,10 @@ function wrap (argv, env, workingDir) {
if (!ChildProcess) {
var child = cp.spawn(process.execPath, [])
ChildProcess = child.constructor
- child.kill('SIGKILL')
+ if (process.platform === 'os390')
+ child.kill('SIGABRT')
+ else
+ child.kill('SIGKILL')
}
// spawn_sync available since Node v0.11
@@ -279,6 +286,8 @@ function mungeEnv (workingDir, options) {
options.envPairs.push('SW_ORIG_' + key + '=' + options.originalNode)
}
+ options.envPairs.push('SPAWN_WRAP_SHIM_ROOT=' + homedir)
+
if (process.env.SPAWN_WRAP_DEBUG === '1')
options.envPairs.push('SPAWN_WRAP_DEBUG=1')
}