From: Nicolas Coden Date: Sun, 1 Apr 2018 16:24:53 +0000 (+0200) Subject: chore: add message for about Husky at precommit & prepush X-Git-Tag: v6.6.0~3^2~253^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaeebbf83;p=thirdparty%2Ffoundation%2Ffoundation-sites.git chore: add message for about Husky at precommit & prepush --- diff --git a/package.json b/package.json index 1098c225e..e1879eb3d 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "deploy:prep": "gulp deploy:prep", "deploy:docs": "gulp deploy:docs", "deploy:beta": "gulp deploy:beta", - "precommit": "npm test", - "prepush": "npm test" + "precommit": "./script/husky-precommit", + "prepush": "./script/husky-prepush" }, "dependencies": { "jquery": ">=3.0.0", diff --git a/script/husky-precommit b/script/husky-precommit new file mode 100755 index 000000000..9c1561358 --- /dev/null +++ b/script/husky-precommit @@ -0,0 +1,10 @@ +#!/bin/bash + +{ + echo -e "\033[33m🐶  Checking tests before committing with Husky...\033[0m" && + npm run test && + echo -e "\033[33m🐶  ✓ Tests run well, we can commit...\033[0m" +} || { + echo -e "\033[33m🐶  ✗ Tests are failing, please fix them before committing.\033[0m" + exit 1 +} diff --git a/script/husky-prepush b/script/husky-prepush new file mode 100755 index 000000000..a5c7e63f9 --- /dev/null +++ b/script/husky-prepush @@ -0,0 +1,10 @@ +#!/bin/bash + +{ + echo -e "\033[33m🐶  Checking tests before pushing with Husky...\033[0m" && + npm run test && + echo -e "\033[33m🐶  ✓ Tests run well, we can push...\033[0m" +} || { + echo -e "\033[33m🐶  ✗ Tests are failing, please fix them before pushing.\033[0m" + exit 1 +}