summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-30 20:32:03 -0500
committerBen Sima <ben@bsima.me>2020-12-30 20:32:03 -0500
commit55c7e1a340a9eddc230a8782b8487844e2876b0d (patch)
treef6add490a21ba616d841fff22388613478be158d
parent0c8322ee39c2bfcb328656b3f666285482974c34 (diff)
colorize sentry output
-rw-r--r--Biz/Bild/Rules.nix3
-rw-r--r--Biz/Bild/ShellHook.sh15
2 files changed, 15 insertions, 3 deletions
diff --git a/Biz/Bild/Rules.nix b/Biz/Bild/Rules.nix
index be9fa31..fcdf025 100644
--- a/Biz/Bild/Rules.nix
+++ b/Biz/Bild/Rules.nix
@@ -128,9 +128,10 @@ in rec {
[ p.black p.pylint ]))
# tools
+ nixpkgs.ccze
nixpkgs.cmark
- nixpkgs.haskell.packages.${ghcCompiler}.fast-tags
nixpkgs.figlet
+ nixpkgs.haskell.packages.${ghcCompiler}.fast-tags
nixpkgs.hlint
nixpkgs.lolcat
nixpkgs.niv.niv
diff --git a/Biz/Bild/ShellHook.sh b/Biz/Bild/ShellHook.sh
index a41d050..b42ab1d 100644
--- a/Biz/Bild/ShellHook.sh
+++ b/Biz/Bild/ShellHook.sh
@@ -87,17 +87,28 @@ function run-sentry() {
https://simatime.com
https://tv.simatime.com
https://bsima.me
+ https://herocomics.app
)
+ RED='\033[0;31m'
+ GRN='\033[0;32m'
+ YEL='\033[0;33m'
+ NC='\033[0m' # No Color
for url in ${urls[@]}
do
code=$(curl -L --max-time 10 --silent --show-error --insecure \
--output /dev/null \
--write-out "%{http_code}" "$url")
- echo "$code $url"
+ case "$code" in
+ 2[0-9][0-9]) printf "${GRN}$code $url${NC}\n";;
+ 3[0-9][0-9]) printf "${YEL}$code $url${NC}\n";;
+ 4[0-9][0-9]) printf "${YEL}$code $url${NC}\n";;
+ 5[0-9][0-9]) printf "${RED}$code $url${NC}\n";;
+ *) printf "${RED}$code $url${NC}\n";;
+ esac
done
}
export -f run-sentry
-alias sentry="watch --exec bash -c run-sentry"
+alias sentry="watch --color --exec bash -c run-sentry"
# Poor man's ci
function run-ci() {