-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargvHelper.js
More file actions
27 lines (25 loc) · 1001 Bytes
/
argvHelper.js
File metadata and controls
27 lines (25 loc) · 1001 Bytes
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
const yargs = require('yargs/yargs')(process.argv.slice(2));
const getArgv = () => {
return yargs
.usage('Usage: $0 [options]')
.example(
'$0 -p -r',
'Update the code and remove the lock file before reinstalling all the packages'
)
.alias('p', 'pull')
.describe('p', 'Update the code before reinstalling all the packages')
.alias('r', 'remove-lock-file')
.describe('r', 'Remove the package-lock.json file if exists')
.alias('l', 'use-lock-file')
.describe('l', 'Use a lock file, runs npm ci --prefer-offline instead of npm i')
.alias('s', 'skip-install')
.describe('s', 'Remove the node_modules folder but skip running npm i')
.alias('q', 'quiet')
.describe('q', 'Run without rmnpm logs (will still show the output of the commands it runs)')
.describe('clear-cache', 'Clear the ‘Total time saved’ data')
.help('h')
.alias('h', 'help')
.alias('v', 'version')
.wrap(null).argv;
};
module.exports = { getArgv };