diff --git a/scripts/cloudflared-ssh.sh b/scripts/cloudflared-ssh.sh index c68521eb..3c702d99 100644 --- a/scripts/cloudflared-ssh.sh +++ b/scripts/cloudflared-ssh.sh @@ -184,9 +184,9 @@ loadHomebrew() { if ! command -v brew > /dev/null; then if [ -f /usr/local/bin/brew ]; then logg info "Using /usr/local/bin/brew" && eval "$(/usr/local/bin/brew shellenv)" - if [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then logg info "Using ${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" && eval "$("${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" shellenv)" - if [ -d "$HOME/.linuxbrew" ]; then + elif [ -d "$HOME/.linuxbrew" ]; then logg info "Using $HOME/.linuxbrew/bin/brew" && eval "$("$HOME/.linuxbrew/bin/brew" shellenv)" elif [ -d "/home/linuxbrew/.linuxbrew" ]; then logg info 'Using /home/linuxbrew/.linuxbrew/bin/brew' && eval "(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" diff --git a/scripts/homebrew.sh b/scripts/homebrew.sh index 15040d72..bf137555 100644 --- a/scripts/homebrew.sh +++ b/scripts/homebrew.sh @@ -153,9 +153,9 @@ loadHomebrew() { if ! command -v brew > /dev/null; then if [ -f /usr/local/bin/brew ]; then logg info "Using /usr/local/bin/brew" && eval "$(/usr/local/bin/brew shellenv)" - if [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then logg info "Using ${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" && eval "$("${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" shellenv)" - if [ -d "$HOME/.linuxbrew" ]; then + elif [ -d "$HOME/.linuxbrew" ]; then logg info "Using $HOME/.linuxbrew/bin/brew" && eval "$("$HOME/.linuxbrew/bin/brew" shellenv)" elif [ -d "/home/linuxbrew/.linuxbrew" ]; then logg info 'Using /home/linuxbrew/.linuxbrew/bin/brew' && eval "(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" diff --git a/scripts/partials/homebrew b/scripts/partials/homebrew index 72e3fc84..95cf1f6c 100644 --- a/scripts/partials/homebrew +++ b/scripts/partials/homebrew @@ -3,9 +3,9 @@ loadHomebrew() { if ! command -v brew > /dev/null; then if [ -f /usr/local/bin/brew ]; then logg info "Using /usr/local/bin/brew" && eval "$(/usr/local/bin/brew shellenv)" - if [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then logg info "Using ${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" && eval "$("${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" shellenv)" - if [ -d "$HOME/.linuxbrew" ]; then + elif [ -d "$HOME/.linuxbrew" ]; then logg info "Using $HOME/.linuxbrew/bin/brew" && eval "$("$HOME/.linuxbrew/bin/brew" shellenv)" elif [ -d "/home/linuxbrew/.linuxbrew" ]; then logg info 'Using /home/linuxbrew/.linuxbrew/bin/brew' && eval "(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" diff --git a/scripts/provision.sh b/scripts/provision.sh index 5d60ee9b..2c6e66d1 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -217,9 +217,9 @@ loadHomebrew() { if ! command -v brew > /dev/null; then if [ -f /usr/local/bin/brew ]; then logg info "Using /usr/local/bin/brew" && eval "$(/usr/local/bin/brew shellenv)" - if [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then + elif [ -f "${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" ]; then logg info "Using ${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" && eval "$("${HOMEBREW_PREFIX:-/opt/homebrew}/bin/brew" shellenv)" - if [ -d "$HOME/.linuxbrew" ]; then + elif [ -d "$HOME/.linuxbrew" ]; then logg info "Using $HOME/.linuxbrew/bin/brew" && eval "$("$HOME/.linuxbrew/bin/brew" shellenv)" elif [ -d "/home/linuxbrew/.linuxbrew" ]; then logg info 'Using /home/linuxbrew/.linuxbrew/bin/brew' && eval "(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"