Skip to content

Commit

Permalink
fix --version
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 28, 2010
1 parent afd3aab commit e0ffeea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ while (arg = argv.shift()) {
options.nocolor = true;
break;
case 'version':
sys.print('vows ');
sys.puts(fs.readFileSync(path.join(__dirname, '..', 'package.json'))
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]);
sys.puts('vows ' + vows.version);
process.exit(0);
case 'help':
case 'h':
Expand Down
5 changes: 5 additions & 0 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// }).run();
//
var sys = require('sys'),
path = require('path'),
events = require('events'),
vows = exports;

Expand Down Expand Up @@ -186,3 +187,7 @@ vows.describe = function (subject) {

return suite;
};


vows.version = require('fs').readFileSync(path.join(__dirname, '..', 'package.json'))
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1];

0 comments on commit e0ffeea

Please sign in to comment.