Add check for existence of 'which' command before proceeding with the script

This commit is contained in:
Tim Burt 2019-11-26 11:24:44 +00:00
parent 51a12d1de8
commit 83d495df2e
1 changed files with 5 additions and 0 deletions

5
sake
View File

@ -9,6 +9,11 @@ Executes a SilverStripe command"
exit 1
fi
if ! [ -x "$(command -v which)" ]; then
echo "Error: sake requires the 'which' command to operate." >&2
exit 1
fi
# find the silverstripe installation, looking first at sake
# bin location, but falling back to current directory
sakedir=`dirname $0`