remove cross-spawn

Do not use cross-spawn, to facilitate the use of process.send node-fork
for pipe communication
This commit is contained in:
yuchonghua 2017-01-19 01:40:35 +08:00
parent 1051b733f9
commit 59a0df86bf
2 changed files with 2 additions and 11 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
var join = require('path').join var join = require('path').join
var spawn = require('cross-spawn').spawn
var defaultCommand = 'dev' var defaultCommand = 'dev'
var commands = new Set([ var commands = new Set([
@ -13,20 +12,13 @@ var commands = new Set([
]) ])
var cmd = process.argv[2] var cmd = process.argv[2]
var args
if (commands.has(cmd)) { if (commands.has(cmd)) {
args = process.argv.slice(3) process.argv.splice(2,1)
} else { } else {
cmd = defaultCommand cmd = defaultCommand
args = process.argv.slice(2)
} }
var bin = join(__dirname, 'nuxt-' + cmd) var bin = join(__dirname, 'nuxt-' + cmd)
var proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }) require(bin);
proc.on('close', (code) => process.exit(code))
proc.on('error', (err) => {
console.error(err) // eslint-disable-line no-console
process.exit(1)
})

View File

@ -56,7 +56,6 @@
"babel-preset-stage-2": "^6.18.0", "babel-preset-stage-2": "^6.18.0",
"chokidar": "^1.6.1", "chokidar": "^1.6.1",
"co": "^4.6.0", "co": "^4.6.0",
"cross-spawn": "^5.0.1",
"css-loader": "^0.26.1", "css-loader": "^0.26.1",
"debug": "^2.6.0", "debug": "^2.6.0",
"extract-text-webpack-plugin": "2.0.0-beta.4", "extract-text-webpack-plugin": "2.0.0-beta.4",