setup.sh: replace type -p with test -e

type -p will exit 1 on failure.
Test makes the intent clearer here.
This commit is contained in:
happysalada 2021-06-23 11:17:02 +09:00 committed by Raphael Megzari
parent ac27528177
commit b49f22fd3e

View file

@ -68,7 +68,7 @@ _callImplicitHook() {
local hookName="$2"
if declare -F "$hookName" > /dev/null; then
"$hookName"
elif type -p "$hookName" > /dev/null; then
elif test -e "$hookName" ; then
source "$hookName"
elif [ -n "${!hookName:-}" ]; then
eval "${!hookName}"