From d84f9c4ec58c39fb1405726cab154a613b068aa0 Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Fri, 29 Nov 2024 01:04:28 -0800 Subject: [PATCH] Colorized status echo, brightened red error --- .husky/pre-commit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 585d831..d2adc74 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,12 @@ #!/bin/bash -RED="\033[1;31m" ; NC="\033[0m" +# Init UI colors +NC="\033[0m" # no color +BR="\033[1;91m" # bright red +BY="\033[1;33m" # bright yellow +# Run ESLint for JavaScript + JSON + Markdown + YAML +echo -e "\n${BY}Running ESLint...${NC}" if npm ls -g eslint &> /dev/null || npm ls eslint &> /dev/null ; then npm run lint else @@ -9,7 +14,7 @@ else cd "$(dirname "$0")/.." && # nav to root [ "$OSTYPE" == "msys" ] && pwd -W || pwd # get absolute path ) - echo -e "\n${RED}Warning: eslint not installed${NC}" + echo -e "\n${BR}Warning: ESLint not installed${NC}" echo -e " To add missing dependencies, run 'npm install' from" echo -e " $PROJECT_ROOT\n" fi