From 7bcfa02eddf5716be9f715037b5d2d5a6f135975 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Feb 2016 19:53:06 -0500 Subject: [PATCH] Know how to write good shell scripts --- Makefile | 3 +-- scripts/run-flow-check.js | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 scripts/run-flow-check.js diff --git a/Makefile b/Makefile index ac3fbc19de..020dab0c0b 100644 --- a/Makefile +++ b/Makefile @@ -38,13 +38,12 @@ test-cov: clean # rebuild with test rm -rf packages/*/lib BABEL_ENV=test; ./node_modules/.bin/gulp build - ./scripts/test-cov.sh test-ci: make lint NODE_ENV=test make bootstrap - node scripts/run-flow-check.js + if ./node_modules/.bin/semver `npm --version` -r ">=3.3.0"; then ./node_modules/.bin/flow check; fi ./scripts/test-cov.sh cat ./coverage/coverage.json | ./node_modules/codecov.io/bin/codecov.io.js diff --git a/scripts/run-flow-check.js b/scripts/run-flow-check.js deleted file mode 100644 index b8c04e6820..0000000000 --- a/scripts/run-flow-check.js +++ /dev/null @@ -1,15 +0,0 @@ -'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) { - process.exit(code); - }); - } -});