Fix command_exists for darwin

This commit is contained in:
Julian Ospald 2019-08-21 19:28:35 +08:00
parent 689ff9e64e
commit 077ed765b7
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

5
ghcup
View File

@ -589,6 +589,7 @@ command_exists() {
# @RETURNS: 0 if all command exists, non-zero otherwise # @RETURNS: 0 if all command exists, non-zero otherwise
check_required_commands() { check_required_commands() {
_missing_commands= _missing_commands=
mydistro=$(get_distro_alias "$(get_distro_name)")
for com in "$@" awk uname basename tar gzip mktemp dirname ; do for com in "$@" awk uname basename tar gzip mktemp dirname ; do
command_exists "${com}" || { command_exists "${com}" || {
@ -606,10 +607,10 @@ check_required_commands() {
if [ -n "${_missing_commands}" ] ; then if [ -n "${_missing_commands}" ] ; then
printf "%s" "${_missing_commands}" printf "%s" "${_missing_commands}"
unset _missing_commands unset _missing_commands mydistro
return 1 return 1
else else
unset _missing_commands unset _missing_commands mydistro
return 0 return 0
fi fi
} }