From 8dcd37f7d4dc910a8eb674710642737fd5cb68a6 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 26 Nov 2025 07:42:08 +0530 Subject: [PATCH] Improve macos php setup Run dependency install as a seperate command. Remove chown command as it is not required anymore it seems Fix add_brew_tap call --- src/scripts/darwin.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index ccd59644..201377ab 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -177,18 +177,19 @@ add_php() { php_formula="shivammathur/php/$php_keg" if [[ "$existing_version" = "false" || -n "$suffix" || "$action" = "upgrade" ]]; then update_dependencies - add_brew_tap + add_brew_tap "$php_tap" fi if [[ "$existing_version" != "false" && -z "$suffix" ]]; then if [ "$action" = "upgrade" ]; then + brew install --only-dependencies "$php_formula" brew upgrade -f --overwrite "$php_formula" else brew unlink "$php_keg" fi else - brew install -f --overwrite "$php_formula" || brew upgrade -f --overwrite "$php_formula" + brew install --only-dependencies "$php_formula" + brew install -f --overwrite "$php_formula" 2>/dev/null || brew upgrade -f --overwrite "$php_formula" fi - sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix" brew link --force --overwrite "$php_keg" }