mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-10-15 20:06:58 +00:00
Resolve PHP formula aliases before invoking Homebrew
This commit is contained in:
1 file changed
+7
-1
@@ -199,7 +199,7 @@ setup_cached_versions() {
|
||||
|
||||
# Function to setup PHP 5.6 and newer using Homebrew.
|
||||
add_php() {
|
||||
local exit_code
|
||||
local exit_code php_alias
|
||||
action=$1
|
||||
existing_version=$2
|
||||
suffix="$(get_php_formula_suffix)"
|
||||
@@ -213,6 +213,12 @@ add_php() {
|
||||
update_dependencies
|
||||
add_brew_tap "$php_tap"
|
||||
fi
|
||||
# Resolve PHP aliases before invoking brew to avoid scanning unrelated installed formulae.
|
||||
php_alias="$tap_dir/$php_tap/Aliases/$php_keg"
|
||||
if [ -L "$php_alias" ]; then
|
||||
php_keg="$(basename "$(readlink "$php_alias")" .rb)"
|
||||
php_formula="shivammathur/php/$php_keg"
|
||||
fi
|
||||
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
|
||||
if [ "$action" = "upgrade" ]; then
|
||||
safe_brew install --only-dependencies "$php_formula" || return $?
|
||||
|
||||
Reference in new issue
Block a user