Skip to content

Commit

Permalink
Don\'t complicate my life and only exec npm -v for crossplataform
Browse files Browse the repository at this point in the history
  • Loading branch information
rog committed May 29, 2016
1 parent 57537c9 commit a908de0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions internals/scripts/npmcheckversion.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/* eslint-disable */
if (!/^win/.test(process.platform)) {
var exec = require('child_process').exec;
exec("if [ $(npm -v | cut -c 1 | awk '{print $1\"<3\"}' | bc -l) != 0 ]; then echo \"[ERROR: React Boilerplate] You need npm version @>=3\n\"; fi;",
function (error, stdout, stderr) {
console.log(stdout);
if (stdout !== '') {
process.exit(1);
}
}
);
}
var exec = require('child_process').exec;
exec('npm -v', function (err, stdout, stderr) {
if (err) throw err;
if (parseFloat(stdout) < 3) {
throw new Error('[ERROR: React Boilerplate] You need npm version @>=3');
process.exit(1);
}
});

0 comments on commit a908de0

Please sign in to comment.