diff options
author | Minteck <contact@minteck.org> | 2022-06-04 08:51:19 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-04 08:51:19 +0200 |
commit | b22f6770c8bd084d66950655203c61dd701b3d90 (patch) | |
tree | 873d7fb19584ec2709b95cc1ca05a1fc7cfd0fc4 /node_modules/nodemon/lib/spawn.js | |
parent | 383285ecd5292bf9a825e05904955b937de84cc9 (diff) | |
download | equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.gz equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.bz2 equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.zip |
Remove node_modules
Diffstat (limited to 'node_modules/nodemon/lib/spawn.js')
-rw-r--r-- | node_modules/nodemon/lib/spawn.js | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/node_modules/nodemon/lib/spawn.js b/node_modules/nodemon/lib/spawn.js deleted file mode 100644 index 9aa4f80..0000000 --- a/node_modules/nodemon/lib/spawn.js +++ /dev/null @@ -1,73 +0,0 @@ -const path = require('path'); -const utils = require('./utils'); -const merge = utils.merge; -const bus = utils.bus; -const spawn = require('child_process').spawn; - -module.exports = function spawnCommand(command, config, eventArgs) { - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - const env = merge(process.env, { FILENAME: eventArgs[0] }); - - var sh = 'sh'; - var shFlag = '-c'; - var spawnOptions = { - env: merge(config.options.execOptions.env, env), - stdio: stdio, - }; - - if (!Array.isArray(command)) { - command = [command]; - } - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - command = command.map(executable => { - if (executable.indexOf('/') === -1) { - return executable; - } - - return executable.split(' ').map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }).join(' '); - }); - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - } - - const args = command.join(' '); - const child = spawn(sh, [shFlag, args], spawnOptions); - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - } -}; |