fix: add colorize helper (#470)

This commit is contained in:
Jason Mobarak
2023-11-29 00:37:00 -08:00
committed by GitHub
parent c85c1c9ed5
commit 38a6561f96

View File

@@ -54,6 +54,12 @@ parse_options() {
done
}
colorize() {
if [ -t 1 ]; then printf "\e[%sm%s\e[m" "$1" "$2"
else echo -n "$2"
fi
}
resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}