Skip to content

Commit

Permalink
Check node.js version before trying to use execSync
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Van Camp committed Apr 10, 2015
1 parent 6e1e479 commit 3f969d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/nodecg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

var chalk = require('chalk');
var execSync = require('child_process').execSync;
var REQUIRED_VERSION = 'v0.11.22';

if (process.version < REQUIRED_VERSION) {
console.error('nodecg-cli relies on %s, which was added to Node.js in %s (your version: %s).',
chalk.cyan('execSync'), chalk.magenta(REQUIRED_VERSION), chalk.magenta(process.version));
console.error('Please upgrade your Node.js installation.');
return;
}

try {
execSync('git --version', { stdio: ['pipe', 'pipe', 'pipe']} );
Expand Down

0 comments on commit 3f969d8

Please sign in to comment.