-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·49 lines (40 loc) · 943 Bytes
/
cli.js
File metadata and controls
executable file
·49 lines (40 loc) · 943 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
'use strict';
const { blue, green } = require('chalk');
const { info, success } = require('log-symbols');
const meow = require('meow');
const updateNotifier = require('update-notifier');
const removeLockfiles = require('.');
const cli = meow(
`
Usage
$ remove-lockfiles [path|options]
Options
--shrinkwrap Remove \`npm-shrinkwrap.json\` if found
Examples
$ remove-lockfiles
$ remove-lockfiles ../foo
$ remove-lockfiles --shrinkwrap
$ remove-lockfiles --shrinkwrap ../foo
`,
{
flags: {
shrinkwrap: {
type: 'boolean',
},
},
}
);
updateNotifier({ pkg: cli.pkg }).notify();
removeLockfiles({
cwd: cli.input[0],
shrinkwrap: cli.flags.shrinkwrap,
}).then(res => {
const { log } = console;
if (res.length === 0) {
log(info, blue('No lockfile found'));
}
if (res.length > 0) {
log(success, green('Removed:\n') + res.join('\n'));
}
});