mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Fix upgrading nightly versions
This commit is contained in:
parent
721e4c3367
commit
2f5c2edb22
@ -137,13 +137,13 @@ add_packaged_php() {
|
||||
|
||||
# Function to update PHP.
|
||||
update_php() {
|
||||
initial_version=$(php_semver)
|
||||
add_packaged_php
|
||||
updated_version=$(php_semver)
|
||||
initial_version="$(php_semver)$(php_extra_version)"
|
||||
add_php
|
||||
updated_version="$(php_semver)$(php_extra_version)"
|
||||
if [ "$updated_version" != "$initial_version" ]; then
|
||||
status="Updated to"
|
||||
else
|
||||
status="Switched to"
|
||||
status="Found"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -155,6 +155,7 @@ add_php() {
|
||||
setup_old_versions
|
||||
else
|
||||
add_packaged_php
|
||||
switch_version >/dev/null 2>&1
|
||||
fi
|
||||
status="Installed"
|
||||
}
|
||||
@ -183,15 +184,15 @@ setup_php() {
|
||||
if [ ! -e "/usr/bin/php$version" ]; then
|
||||
add_php >/dev/null 2>&1
|
||||
else
|
||||
if ! [[ "$version" =~ ${old_versions:?} ]]; then
|
||||
switch_version >/dev/null 2>&1
|
||||
fi
|
||||
if [ "${update:?}" = "true" ]; then
|
||||
update_php >/dev/null 2>&1
|
||||
else
|
||||
status="Switched to"
|
||||
fi
|
||||
fi
|
||||
if ! [[ "$version" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
|
||||
switch_version >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
if [ "$update" = "true" ]; then
|
||||
update_php >/dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user