zsh: Use $+commands[] instead of command -v

This commit is contained in:
2022-03-31 00:46:46 +02:00
parent 8008cb1a63
commit 0ba0c04c56
6 changed files with 15 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
# Bold red
if command -v tput >/dev/null 2>&1; then
if (( $+commands[tput] )); then
STDERRED_ESC_CODE="$(tput bold && tput setaf 1)"
else
STDERRED_ESC_CODE="\e[1m\e31m"