only run flow check in CI if npm 3

This commit is contained in:
Henry Zhu
2016-02-02 21:14:43 -05:00
parent 3522148255
commit f59faeeeaa
3 changed files with 17 additions and 1 deletions

15
scripts/run-flow-check.js Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
var binVersionCheck = require("bin-version-check");
var child = require("child_process");
// run in npm 3+ only
binVersionCheck("npm", ">=3.3.0", function (err) {
if (!err) {
console.log("Running ./node_modules/.bin/flow check");
var cmd = child.spawn("./node_modules/.bin/flow", ["check"], { stdio: "inherit" });
cmd.on("exit", function(code) {
console.log(code);
});
}
});