mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-05 21:53:56 +00:00
32 lines
558 B
JavaScript
Executable File
32 lines
558 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const join = require('path').join
|
|
|
|
const defaultCommand = 'dev'
|
|
const commands = new Set([
|
|
defaultCommand,
|
|
'init',
|
|
'build',
|
|
'start',
|
|
'generate'
|
|
])
|
|
|
|
var cmd = process.argv[2]
|
|
|
|
if (commands.has(cmd)) {
|
|
process.argv.splice(2, 1)
|
|
} else {
|
|
cmd = defaultCommand
|
|
}
|
|
|
|
const bin = join(__dirname, 'nuxt-' + cmd)
|
|
|
|
// Console error unhandled promises
|
|
process.on('unhandledRejection', function (err) {
|
|
/* eslint-disable no-console */
|
|
console.error(err)
|
|
console.error('[nuxt] Unhandled promise rejection: ' + err)
|
|
})
|
|
|
|
require(bin)
|