zsh: Use dictionary for command existence check

Use the `commands` dictionary from zsh instead of always calling
`command`.

Regex used:
s/command -v \([^ ]*\) &>\/dev\/null/(( $+commands[\1] ))/g
This commit is contained in:
2020-12-28 02:58:46 +01:00
parent 4a0b9e5cf1
commit a440e8b61e
3 changed files with 10 additions and 10 deletions

View File

@@ -1 +1 @@
! command -v direnv &>/dev/null || eval "$(direnv hook zsh)"
! (( $+commands[direnv] )) || eval "$(direnv hook zsh)"