-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·63 lines (48 loc) · 976 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env node
'use strict';
const minimist = require('minimist')
const error = require('./lib/error.js')
const criticalCss = require('./lib/critical-css.js').process
const args = minimist(process.argv.slice(2))
let cmd = args._[0] || 'help'
if (args.version || args.v) {
cmd = 'version'
}
if (args.help || args.h) {
cmd = 'help'
}
switch (cmd) {
case 'dev':
require('./cli/dev.js')
break
case 'build':
require('./cli/build')
break
case 'release':
require('./cli/release')
break
case 'deploy':
require('./cli/deploy')
break
case 'newpattern':
require('./cli/newpattern')
break
case 'version':
require('./lib/version')(args)
break
case 'update':
require('./lib/update')
break
case 'help':
require('./lib/help')(args)
break
case 'jest':
require('./cli/jest.js')
break
default:
error(`"${cmd}" is not a valid command!`, true)
break
}
module.exports = {
criticalCss
};