Skip to content

Commit 77b94d7

Browse files
committed
Show version
1 parent 47bf3b6 commit 77b94d7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bin/ready.coffee

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ argv = optimist.argv
2727

2828
# Display version
2929
if argv.v?
30-
extrafs.readJSONFile './package.json', (err, pack)->
31-
log pack.version
30+
require('../lib/version') (version)->
31+
log version
32+
3233
return
3334

3435
return optimist.showHelp() if argv._.length == 0 || argv.help?

lib/version.coffee

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
path = require 'path'
2+
extrafs = require '../node_modules/fs-extra'
3+
4+
module.exports = (callback)->
5+
extrafs.readJSONFile path.join(__dirname, "../", "package.json"), (err, pack)->
6+
callback(pack.version)
7+

0 commit comments

Comments
 (0)