diff options
Diffstat (limited to 'node_modules/spawn-wrap')
-rw-r--r-- | node_modules/spawn-wrap/README.md | 14 | ||||
-rw-r--r-- | node_modules/spawn-wrap/index.js | 15 | ||||
-rw-r--r-- | node_modules/spawn-wrap/package.json | 10 |
3 files changed, 31 insertions, 8 deletions
diff --git a/node_modules/spawn-wrap/README.md b/node_modules/spawn-wrap/README.md index 0cac17fa5..428df37e5 100644 --- a/node_modules/spawn-wrap/README.md +++ b/node_modules/spawn-wrap/README.md @@ -52,6 +52,20 @@ process.on('exit', function (code) { require('spawn-wrap').runMain() ``` +## ENVIRONMENT VARIABLES + +Spawn-wrap responds to two environment variables, both of which are +preserved through child processes. + +`SPAWN_WRAP_DEBUG=1` in the environment will make this module dump a +lot of information to stderr. + +`SPAWN_WRAP_SHIM_ROOT` can be set to a path on the filesystem where +the shim files are written in a `.node-spawn-wrap-<id>` folder. By +default this is done in `$HOME`, but in some environments you may wish +to point it at some other root. (For example, if `$HOME` is mounted +as read-only in a virtual machine or container.) + ## CONTRACTS and CAVEATS The initial wrap call uses synchronous I/O. Probably you should not 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') } diff --git a/node_modules/spawn-wrap/package.json b/node_modules/spawn-wrap/package.json index ee4120577..48c210054 100644 --- a/node_modules/spawn-wrap/package.json +++ b/node_modules/spawn-wrap/package.json @@ -1,18 +1,18 @@ { "name": "spawn-wrap", - "version": "1.3.8", + "version": "1.4.2", "description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.", "main": "index.js", "dependencies": { "foreground-child": "^1.5.6", "mkdirp": "^0.5.0", "os-homedir": "^1.0.1", - "rimraf": "^2.3.3", + "rimraf": "^2.6.2", "signal-exit": "^3.0.2", - "which": "^1.2.4" + "which": "^1.3.0" }, "scripts": { - "test": "tap test/*.js", + "test": "tap --timeout=240 test/*.js", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags", @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/isaacs/spawn-wrap#readme", "devDependencies": { - "tap": "^10.1.0" + "tap": "^10.7.3" }, "files": [ "index.js", |