traewelling: only output colors when allowed

This commit is contained in:
Daniella / Tove 2024-10-22 21:30:55 +02:00
parent 7089e94f21
commit 611bb49a50
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -4,7 +4,9 @@ pkgs.writeShellScriptBin "traewelling" ''
#!/bin/sh
function color() {
echo -ne "\e[38;5;$1"m
if test -t 1 ; then
echo -ne "\e[38;5;$1"m
fi
}
function j() {
jq -r $1 <<< "$json"