mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
commit
45908385ad
12
bin/nuxt
12
bin/nuxt
@ -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)
|
|
||||||
})
|
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user