From: Nicolas Coden Date: Sat, 16 Jun 2018 07:49:45 +0000 (+0200) Subject: Use pull request #11120 from ncoden/fix/prevent-commit-with-failing-tests for v6.5.0 X-Git-Tag: v6.5.0-rc.1^2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40d995d1096f7fbf856977e3ee5e6d66b2632956;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Use pull request #11120 from ncoden/fix/prevent-commit-with-failing-tests for v6.5.0 47da3c064 fix: prevent push/commit with falling tests with Husky Signed-off-by: Nicolas Coden --- diff --git a/script/husky-precommit.js b/script/husky-precommit.js index facf88661..b7944ff7a 100644 --- a/script/husky-precommit.js +++ b/script/husky-precommit.js @@ -9,14 +9,15 @@ child.stdout.on('data', function (data) { process.stdout.write(data) }) +child.on('error', function (err) { + console.log(chalk.red(err)) +}) + child.on('exit', function (code) { if(code === 0){ console.log(chalk.yellow('🐶 ✓ Tests run well, we can commit...')) } else { console.log(chalk.yellow('🐶 ✗ Tests are failing, please fix them before committing.')) + process.exit(code); } }) - -child.on('error', function (err) { - console.log(chalk.red(err)) -}) \ No newline at end of file diff --git a/script/husky-prepush.js b/script/husky-prepush.js index 22ad2a610..1594b13ee 100644 --- a/script/husky-prepush.js +++ b/script/husky-prepush.js @@ -9,14 +9,15 @@ child.stdout.on('data', function (data) { process.stdout.write(data) }) +child.on('error', function (err) { + console.log(chalk.red(err)) +}) + child.on('exit', function (code) { if(code === 0){ console.log(chalk.yellow('🐶 ✓ Tests run well, we can push...')) } else { console.log(chalk.yellow('🐶 ✗ Tests are failing, please fix them before pushing.')) + process.exit(code); } }) - -child.on('error', function (err) { - console.log(chalk.red(err)) -}) \ No newline at end of file