-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Colorized status echo, brightened red error
- Loading branch information
Showing
1 changed file
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
#!/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 | ||
PROJECT_ROOT=$( | ||
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 |