From 78f9bca3ecba5516d5eb5f28125ccbbcd275754b Mon Sep 17 00:00:00 2001 From: Kevin Perez Date: Tue, 21 May 2019 13:33:08 -0500 Subject: [PATCH] make --version show the same value inside package.json The CLI flag "--version" wasn't showing the right version of the package. It had a hardcoded version number that needed to be changed along with the one inside package.json and sometime ago people stopped updating it. This implementation ensures the "--version" flag always report the same value inside package.json, without any need for manually updating. --- lib/jasmine-node/cli.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jasmine-node/cli.js b/lib/jasmine-node/cli.js index c006aa0..0ef0f7b 100755 --- a/lib/jasmine-node/cli.js +++ b/lib/jasmine-node/cli.js @@ -175,9 +175,8 @@ if (specFolders.length === 0) { } if (autotest) { - var patterns = ['**/*.js']; - + if (extensions.indexOf("coffee") !== -1) { patterns.push('**/*.coffee'); } @@ -282,6 +281,7 @@ function help(){ } function printVersion(){ - console.log("1.14.?"); + const package = require(__dirname + '/../../package.json') + console.log(package.version); process.exit(0); }