From eaeebbf8370352c21741fa23163aec154ace9a9f Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Sun, 1 Apr 2018 18:24:53 +0200 Subject: [PATCH] chore: add message for about Husky at precommit & prepush --- package.json | 4 ++-- script/husky-precommit | 10 ++++++++++ script/husky-prepush | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 script/husky-precommit create mode 100755 script/husky-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 +} -- 2.47.2