sh: Use exist program

Fix sh module packages to make more extensive use of the exist program
that also ships with the sh module.
Simplifies intent of the code and makes it much easier to read.
This commit is contained in:
Marty Oehme 2022-01-30 11:37:18 +01:00
parent ea95ca7dfa
commit a27d86942b
Signed by: Marty
GPG key ID: B7538B8F50A1C800
3 changed files with 8 additions and 8 deletions

View file

@ -61,6 +61,8 @@ if exist fzf; then
fzf_pkg_tool=yay
elif exist paru; then
fzf_pkg_tool=paru
elif exist pacman; then
fzf_pkg_tool=pacman
fi
# shellcheck disable=2139 # we *want* this to be done at shell startup instead of dynamically
if [ -n "$fzf_pkg_tool" ]; then
@ -89,6 +91,4 @@ fi
if exist vifm; then
alias vm=vifm
alias vmm='vifm ${PWD}'
# enable picture preview script
exist vifmrun && alias vifm=vifmrun
fi