mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Uprade existing macOS version
This commit is contained in:
parent
f4fb0af4d5
commit
73963f5001
@ -140,17 +140,6 @@ update_dependencies() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to fix dependencies on install PHP version.
|
|
||||||
fix_dependencies() {
|
|
||||||
broken_deps_paths=$(php -v 2>&1 | grep -Eo '/opt/[a-zA-Z0-9@\.]+')
|
|
||||||
if [ "x$broken_deps_paths" != "x" ]; then
|
|
||||||
update_dependencies
|
|
||||||
IFS=" " read -r -a formulae <<< "$(echo "$broken_deps_paths" | tr '\n' ' ' | sed 's|/opt/||g' 2>&1)$php_formula"
|
|
||||||
brew reinstall "${formulae[@]}"
|
|
||||||
brew link --force --overwrite "$php_formula" || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to get PHP version if it is already installed using Homebrew.
|
# Function to get PHP version if it is already installed using Homebrew.
|
||||||
get_brewed_php() {
|
get_brewed_php() {
|
||||||
cellar="$brew_prefix"/Cellar
|
cellar="$brew_prefix"/Cellar
|
||||||
@ -232,8 +221,8 @@ setup_php() {
|
|||||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||||
status="Updated to"
|
status="Updated to"
|
||||||
else
|
else
|
||||||
status="Found"
|
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||||
fix_dependencies >/dev/null 2>&1
|
status="Updated to"
|
||||||
fi
|
fi
|
||||||
php_config="$(command -v php-config)"
|
php_config="$(command -v php-config)"
|
||||||
ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)"
|
ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)"
|
||||||
|
Loading…
Reference in New Issue
Block a user