now has working version

This commit is contained in:
Philipp Kunz 2016-06-25 11:58:33 +02:00
parent c495f20b3d
commit 7de38ce050
3 changed files with 17 additions and 7 deletions

10
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,8 @@
"npmci": "dist/index.js"
},
"scripts": {
"test": "(npmts)"
"test": "(npmts) && (npm run testVersion)",
"testVersion":"node dist/index.js -v"
},
"repository": {
"type": "git",

View File

@ -22,8 +22,8 @@ export {publish} from "./npmci.publish";
let command;
let commandOption:string;
plugins.commander
.version(npmciInfo.version)
let commander = plugins.commander
.option("-v","--version","print version")
.arguments('<commandarg> [commandoptionarg]')
.action(function (commandarg, commandoptionarg) {
command = commandarg;
@ -32,6 +32,11 @@ plugins.commander
plugins.commander.parse(process.argv);
if(commander.version) {
console.log(npmciInfo.version);
process.exit(0);
}
if (typeof command === 'undefined') {
console.error('no command given!');
process.exit(1);