1 | #!/usr/bin/env node
|
2 |
|
3 | const join = require('path').join
|
4 | require('../lib/common/cli/errors')
|
5 |
|
6 | const defaultCommand = 'dev'
|
7 | const commands = new Set([
|
8 | defaultCommand,
|
9 | 'init',
|
10 | 'build',
|
11 | 'start',
|
12 | 'generate'
|
13 | ])
|
14 |
|
15 | var cmd = process.argv[2]
|
16 |
|
17 | if (commands.has(cmd)) {
|
18 | process.argv.splice(2, 1)
|
19 | } else {
|
20 | cmd = defaultCommand
|
21 | }
|
22 |
|
23 | const bin = join(__dirname, 'nuxt-' + cmd)
|
24 |
|
25 | require(bin)
|