-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
37 lines (29 loc) · 761 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env node
'use strict'
const rasper = require('rasper')
const pkg = require('./package.json')
const app = require('./index')
const options = process.argv[0].match(/node/i)
? rasper(process.argv.slice(2))
: rasper()
if (options.help || options.h) help()
if (options.version || options.v) version()
app(options)
function help () {
console.info(`
Usage:
$ pwa-installer <directory> [<options>]
Options:
-h, --help Display help information
-v, --version Output version
-c, --config Display help information
Examples:
$ pwa-installer dist
$ pwa-installer dist --config=pwa.config.js
`)
process.exit(1)
}
function version () {
console.info(pkg.version)
process.exit(1)
}