vendor-install: check -x on output of which

This works around older versions of `which`, which return a
string on failure.
This commit is contained in:
Misty De Meo 2017-05-23 18:34:16 -07:00
parent fdd9972aa7
commit b8fee7fe4d
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C

View File

@ -76,10 +76,10 @@ fetch() {
trap - SIGINT
fi
if [[ -n "$(which shasum)" ]]
if [[ -x "$(which shasum)" ]]
then
sha="$(shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)"
elif [[ -n "$(which sha256sum)" ]]
elif [[ -x "$(which sha256sum)" ]]
then
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
else