Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit 35c2e97

Browse files
committed
Support --version
1 parent 7ebf08c commit 35c2e97

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cli.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/usr/bin/env node
22
var npmPkgr = require('./');
3+
var argv = require('minimist')(process.argv.slice(2));
4+
5+
if (argv.version) {
6+
console.log(require('./package.json').version);
7+
process.exit(0);
8+
}
39

410
npmPkgr({
511
cwd: process.cwd(),
612
args: process.argv.slice(2),
7-
strategy: require('minimist')(process.argv.slice(2)).strategy
13+
strategy: argv.strategy
814
}, end);
915

1016
function end(err, res) {
@@ -23,4 +29,4 @@ function end(err, res) {
2329
if (!res.npm) {
2430
console.log('`npm install` was not used');
2531
}
26-
}
32+
}

0 commit comments

Comments
 (0)