Skip to content

Commit

Permalink
Fix upgrading nightly versions
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 18, 2021
1 parent 721e4c3 commit 2f5c2ed
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/scripts/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -155,6 +155,7 @@ add_php() {
setup_old_versions
else
add_packaged_php
switch_version >/dev/null 2>&1
fi
status="Installed"
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2f5c2ed

Please sign in to comment.