]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: prevent push/commit with falling tests with Husky 11120/head
authorNicolas Coden <nicolas@ncoden.fr>
Mon, 2 Apr 2018 19:46:24 +0000 (21:46 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Mon, 2 Apr 2018 19:46:24 +0000 (21:46 +0200)
script/husky-precommit.js
script/husky-prepush.js

index facf886616311da0c4205170658f2debd7acce3c..b7944ff7a2490d5c9632119f84900f10fe98c34f 100644 (file)
@@ -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
index 22ad2a6101088eb2998da41a8f03f9e19e09563d..1594b13eeb7f354280f9e94cb802b7bc145e50e5 100644 (file)
@@ -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