FIX 'which' check in 'sake' now works for aliases
Improves on the current implementations since 'command' already only returns executable commands. Additionally, the success output of 'command' is not standardized and may contain additional information. Therefore, a 'test' if the result of 'command' is a valid executable file, may fail incorrectly. Now just relying on the standardized exit status of 'command -v'.
This commit is contained in:
parent
0c8fcfb54c
commit
f8ba11e7f3
5
sake
5
sake
|
@ -9,10 +9,7 @@ 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
|
||||
command -v which >/dev/null 2>&1 || { echo >&2 "Error: sake requires the 'which' command to operate."; exit 1; }
|
||||
|
||||
# find the silverstripe installation, looking first at sake
|
||||
# bin location, but falling back to current directory
|
||||
|
|
Loading…
Reference in New Issue