1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

add cli version flags (#435)

* add version flags

* fix typo -.-
This commit is contained in:
Luke Edwards 2016-12-19 12:14:23 -08:00 committed by Guillermo Rauch
parent fce87e6e65
commit ff7e128c80

View file

@ -3,6 +3,7 @@
import { join } from 'path'
import { spawn } from 'cross-spawn'
import { watchFile } from 'fs'
import pkg from '../../package.json'
const defaultCommand = 'dev'
const commands = new Set([
@ -15,6 +16,11 @@ const commands = new Set([
let cmd = process.argv[2]
let args
if (new Set(['--version', '-v']).has(cmd)) {
console.log(`next.js v${pkg.version}`)
process.exit(0)
}
if (new Set(['--help', '-h']).has(cmd)) {
console.log(`
Usage