Skip to content

Commit 726492f

Browse files
committed
Colorized status echo, brightened red error
1 parent 7f18733 commit 726492f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.husky/pre-commit

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
#!/bin/bash
22

3-
RED="\033[1;31m" ; NC="\033[0m"
3+
# Init UI colors
4+
NC="\033[0m" # no color
5+
BR="\033[1;91m" # bright red
6+
BY="\033[1;33m" # bright yellow
47

8+
# Run ESLint for JavaScript + JSON + Markdown + YAML
9+
echo -e "\n${BY}Running ESLint...${NC}"
510
if npm ls -g eslint &> /dev/null || npm ls eslint &> /dev/null ; then
611
npm run lint
712
else
813
PROJECT_ROOT=$(
914
cd "$(dirname "$0")/.." && # nav to root
1015
[ "$OSTYPE" == "msys" ] && pwd -W || pwd # get absolute path
1116
)
12-
echo -e "\n${RED}Warning: eslint not installed${NC}"
17+
echo -e "\n${BR}Warning: ESLint not installed${NC}"
1318
echo -e " To add missing dependencies, run 'npm install' from"
1419
echo -e " $PROJECT_ROOT\n"
1520
fi

0 commit comments

Comments
 (0)