Skip to content

Commit e0ffeea

Browse files
author
cloudhead
committed
fix --version
1 parent afd3aab commit e0ffeea

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bin/vows

+1-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ while (arg = argv.shift()) {
100100
options.nocolor = true;
101101
break;
102102
case 'version':
103-
sys.print('vows ');
104-
sys.puts(fs.readFileSync(path.join(__dirname, '..', 'package.json'))
105-
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1]);
103+
sys.puts('vows ' + vows.version);
106104
process.exit(0);
107105
case 'help':
108106
case 'h':

lib/vows.js

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// }).run();
1717
//
1818
var sys = require('sys'),
19+
path = require('path'),
1920
events = require('events'),
2021
vows = exports;
2122

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

187188
return suite;
188189
};
190+
191+
192+
vows.version = require('fs').readFileSync(path.join(__dirname, '..', 'package.json'))
193+
.toString().match(/"version"\s*:\s*"([\d.]+)"/)[1];

0 commit comments

Comments
 (0)