Skip to content

Commit

Permalink
only run flow check in CI if npm 3
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Feb 4, 2016
1 parent 210f78d commit 640a80b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test-cov: clean
test-ci:
make lint
NODE_ENV=test make bootstrap
./node_modules/.bin/flow check
node scripts/run-flow-check.js
./scripts/test-cov.sh
cat ./coverage/coverage.json | ./node_modules/codecov.io/bin/codecov.io.js

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"babel": "5.8.21",
"babel-eslint": "^4.1.8",
"babel-plugin-flow-comments": "^1.0.9",
"bin-version-check": "^2.1.0",
"browserify": "^11.2.0",
"bundle-collapser": "^1.2.1",
"chai": "^2.2.0",
Expand Down
15 changes: 15 additions & 0 deletions scripts/run-flow-check.js
Original file line number Diff line number Diff line change
@@ -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);
});
}
});

0 comments on commit 640a80b

Please sign in to comment.