Fix ./main.js --version

This commit is contained in:
Bryan Ashby 2018-11-14 19:53:14 -07:00
parent 23c9e89849
commit 941e7d0a03
1 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,10 @@ function printHelpAndExit() {
process.exit(); process.exit();
} }
function printVersionAndExit() {
console.info(require('../package.json').version);
}
function main() { function main() {
async.waterfall( async.waterfall(
[ [
@ -52,7 +56,11 @@ function main() {
const argv = require('minimist')(process.argv.slice(2)); const argv = require('minimist')(process.argv.slice(2));
if(argv.help) { if(argv.help) {
printHelpAndExit(); return printHelpAndExit();
}
if(argv.version) {
return printVersionAndExit();
} }
const configOverridePath = argv.config; const configOverridePath = argv.config;