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

@@ -15,7 +15,8 @@ builtin emulate -L zsh -o no_glob_dots -o null_glob
builtin local LS_SHOW_ALL_DIRS=${LS_SHOW_ALL_DIRS:-"dotfiles|\.config"}
builtin local LS_COMMAND=ls
if [[ $OSTYPE =~ darwin ]] && command -v gls &>/dev/null; then
# Use GNU version if available under MacOS
if [[ $OSTYPE =~ darwin ]] && (( $+commands[gls] )); then
LS_COMMAND=gls
fi