Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #154 from Financial-Times/version
Browse files Browse the repository at this point in the history
--version
  • Loading branch information
Alberto Elias committed Dec 8, 2014
2 parents 32b87ac + c306b75 commit 4e7d0d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/origami-build-tools-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ function printUsage(commands) {
console.log('Full documentation: http://git.io/bBjMNw');
}

// Mini-hack to make Origami Build Tools support the pseudo standard CLI language of --version
if (argv.version) {
delete argv.version;
argv._[0] = '--version';
}

var watch = !!argv.watch,
argument = argv._[0];

Expand Down
4 changes: 3 additions & 1 deletion lib/origami-build-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var builder = require('./tasks/build');
var tester = require('./tasks/test');
var demoer = require('./tasks/demo');
var docs = require('./tasks/docs');
var version = require('./tasks/version');

update();

Expand All @@ -18,7 +19,8 @@ var tasks = {
'demo': demoer,
'verify': verifier,
'test': tester,
'docs': docs
'docs': docs,
'--version': version
};

module.exports = tasks;
4 changes: 4 additions & 0 deletions lib/tasks/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function() {
console.log("v"+require(__dirname + '/../../package.json').version);
};
module.exports.description = 'Print the installed version of Origami Build Tools';

0 comments on commit 4e7d0d3

Please sign in to comment.