-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·56 lines (52 loc) · 1.39 KB
/
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
#!/usr/bin/env node
/**
* @file CLI Configuration
*/
// External
const path = require('path');
// Commands
const install = require('./commands/install');
require('yargs') // eslint-disable-line no-unused-expressions
.command({
command: 'install',
aliases: ['i'],
desc: 'Wrapper for npm install that provides a caching layer for node_modules/',
builder: yargs => yargs
.option('production', {
alias: 'p',
describe: 'Do not install devDependencies. Does not work with --ci',
boolean: true,
default: true
})
.option('ci', {
describe: 'Use npm ci instead of npm install',
boolean: true,
default: false
})
.option('gzip', {
alias: 'g',
describe: 'Use gzip to compress tarballs',
boolean: true,
default: true
})
.option('force', {
alias: 'f',
describe: 'Overwrite existing cache',
boolean: true,
default: false
})
.option('clean', {
alias: 'c',
describe: 'Delete existing node_modules before installing. This happens automatically when using --ci',
boolean: true,
default: false
})
.option('cache-directory', {
alias: 'd',
describe: 'The folder where the tarballs are saved',
default: '~/.sc-cache'
}),
handler: install
})
.demandCommand()
.argv;