Skip to content

Commit

Permalink
fix(setup): run git fetch before attempting to check out an updated…
Browse files Browse the repository at this point in the history
… release
  • Loading branch information
Alex Van Camp committed Mar 6, 2016
1 parent c476aa3 commit aa352c2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commands/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ function action(version, options) {
var nodecgPath = util.getNodeCGPath();
var current = JSON.parse(fs.readFileSync(nodecgPath + '/package.json')).version;

process.stdout.write('Downloading latest release...');
try {
execSync('git fetch', {stdio: ['pipe', 'pipe', 'pipe']});
process.stdout.write(chalk.green('done!') + os.EOL);
} catch (e) {
/* istanbul ignore next */
process.stdout.write(chalk.red('failed!') + os.EOL);
/* istanbul ignore next */
console.error(e.stack);
/* istanbul ignore next */
return;
}

if (semver.eq(target, current)) {
console.log('The target version (%s) is equal to the current version (%s). No action will be taken.',
chalk.magenta(target), chalk.magenta(current));
Expand Down

0 comments on commit aa352c2

Please sign in to comment.