From 83d495df2e672e5d4388da3dd1ce9047df51036b Mon Sep 17 00:00:00 2001 From: Tim Burt Date: Tue, 26 Nov 2019 11:24:44 +0000 Subject: [PATCH] Add check for existence of 'which' command before proceeding with the script --- sake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sake b/sake index 9c177a08b..3fac1c411 100755 --- a/sake +++ b/sake @@ -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`