mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +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.
|
# Function to update PHP.
|
||||||
update_php() {
|
update_php() {
|
||||||
initial_version=$(php_semver)
|
initial_version="$(php_semver)$(php_extra_version)"
|
||||||
add_packaged_php
|
add_php
|
||||||
updated_version=$(php_semver)
|
updated_version="$(php_semver)$(php_extra_version)"
|
||||||
if [ "$updated_version" != "$initial_version" ]; then
|
if [ "$updated_version" != "$initial_version" ]; then
|
||||||
status="Updated to"
|
status="Updated to"
|
||||||
else
|
else
|
||||||
status="Switched to"
|
status="Found"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,6 +155,7 @@ add_php() {
|
|||||||
setup_old_versions
|
setup_old_versions
|
||||||
else
|
else
|
||||||
add_packaged_php
|
add_packaged_php
|
||||||
|
switch_version >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
status="Installed"
|
status="Installed"
|
||||||
}
|
}
|
||||||
@ -183,15 +184,15 @@ setup_php() {
|
|||||||
if [ ! -e "/usr/bin/php$version" ]; then
|
if [ ! -e "/usr/bin/php$version" ]; then
|
||||||
add_php >/dev/null 2>&1
|
add_php >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
|
if ! [[ "$version" =~ ${old_versions:?} ]]; then
|
||||||
|
switch_version >/dev/null 2>&1
|
||||||
|
fi
|
||||||
if [ "${update:?}" = "true" ]; then
|
if [ "${update:?}" = "true" ]; then
|
||||||
update_php >/dev/null 2>&1
|
update_php >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
status="Switched to"
|
status="Switched to"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! [[ "$version" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
|
|
||||||
switch_version >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if [ "$update" = "true" ]; then
|
if [ "$update" = "true" ]; then
|
||||||
update_php >/dev/null 2>&1
|
update_php >/dev/null 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user