From 63b8b6fedad6de24b1d206d12ade9945ec257a70 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 9 Sep 2026 09:01:18 +0530 Subject: [PATCH] Stop Intel macOS installs when the package cache fails --- src/scripts/darwin.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 3437118e..49018876 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -189,9 +189,9 @@ add_php() { php_keg="php@$version$suffix" php_formula="shivammathur/php/$php_keg" if [[ "$existing_version" = "false" || -n "$suffix" || "$action" = "upgrade" ]]; then - if [ "${runner:?}" != "self-hosted" ] && \ - [ "${use_package_cache:-true}" != "false" ] && setup_cached_versions; then - return 0 + if [ "${runner:?}" != "self-hosted" ] && [ "${use_package_cache:-true}" != "false" ]; then + setup_cached_versions && return 0 + [ "$(uname -m)" != "x86_64" ] || return 1 fi update_dependencies add_brew_tap "$php_tap" @@ -264,12 +264,18 @@ setup_php() { run_script "php5-darwin" "${version/./}" >/dev/null 2>&1 status="Installed" elif [[ "${existing_version:0:3}" != "$version" || -n "$(get_php_formula_suffix)" ]]; then - add_php "install" "$existing_version" >/dev/null 2>&1 + add_php "install" "$existing_version" >/dev/null 2>&1 || { + add_log "${cross:?}" "PHP" "Could not install PHP $version" + exit 1 + } status="Installed" elif [[ "${existing_version:0:3}" = "$version" && "${update:?}" = "true" ]]; then brew_php_version="$(brew info --json "php@$version" 2>/dev/null | jq -r '.[].versions.stable')" if [ "$brew_php_version" != "$existing_version" ]; then - add_php "upgrade" "$existing_version" >/dev/null 2>&1 + add_php "upgrade" "$existing_version" >/dev/null 2>&1 || { + add_log "${cross:?}" "PHP" "Could not upgrade PHP $version" + exit 1 + } status="Upgraded" fi fi