Skip to content

Commit

Permalink
Read version info from package.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreh committed Oct 9, 2011
1 parent bc5ffcc commit 86c0db0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.js
Expand Up @@ -4,6 +4,9 @@ var program = require('commander');
var server = require('./server/server');
var project = require('./server/project');
var exec = require('child_process').exec
var fs = require('fs')

var packageJSON = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf-8'))

var checkForDependencies = function(callback) {
exec('which npm', function(err, stdout, stderr) {
Expand All @@ -17,7 +20,7 @@ var checkForDependencies = function(callback) {
}

program
.version('0.1.4')
.version(packageJSON.version)
.option('-p, --port <number>', 'use a custom http port')

program
Expand Down

0 comments on commit 86c0db0

Please sign in to comment.