mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-01-18 22:31:45 +07:00
Do not upgrade when version is pre-installed on macOS
This commit is contained in:
parent
da729085ef
commit
775fa76ea4
@ -213,6 +213,7 @@ get_scan_dir() {
|
|||||||
setup_php() {
|
setup_php() {
|
||||||
step_log "Setup PHP"
|
step_log "Setup PHP"
|
||||||
php_config="$(command -v php-config 2>/dev/null)"
|
php_config="$(command -v php-config 2>/dev/null)"
|
||||||
|
update=true
|
||||||
check_pre_installed
|
check_pre_installed
|
||||||
existing_version=$(get_brewed_php)
|
existing_version=$(get_brewed_php)
|
||||||
if [[ "$version" =~ ${old_versions:?} ]]; then
|
if [[ "$version" =~ ${old_versions:?} ]]; then
|
||||||
@ -221,12 +222,13 @@ setup_php() {
|
|||||||
elif [ "$existing_version" != "$version" ]; then
|
elif [ "$existing_version" != "$version" ]; then
|
||||||
add_php "install" "$existing_version" >/dev/null 2>&1
|
add_php "install" "$existing_version" >/dev/null 2>&1
|
||||||
status="Installed"
|
status="Installed"
|
||||||
elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then
|
elif [ "$existing_version" = "$version" ]; then
|
||||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
if [ "${update:?}" = "true" ]; then
|
||||||
status="Updated to"
|
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||||
else
|
status="Updated to"
|
||||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
else
|
||||||
status="Updated to"
|
status="Found"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
php_config="$(command -v php-config)"
|
php_config="$(command -v php-config)"
|
||||||
ext_dir="$(sed -n "s/.*extension_dir=['\"]\(.*\)['\"].*/\1/p" "$php_config")"
|
ext_dir="$(sed -n "s/.*extension_dir=['\"]\(.*\)['\"].*/\1/p" "$php_config")"
|
||||||
|
Loading…
Reference in New Issue
Block a user