Fix selfupdate bug.

This commit is contained in:
Marco Vermeulen
2022-03-09 20:49:30 +00:00
committed by Marco Vermeulen
parent f61702c006
commit fd2ed04a4e
2 changed files with 7 additions and 5 deletions

View File

@@ -24,12 +24,13 @@ function __sdk_selfupdate() {
echo "This command is not available while offline."
elif [[ "$SDKMAN_REMOTE_VERSION" == "$SDKMAN_VERSION" && "$force_selfupdate" != "force" ]]; then
echo "No update available at this time."
elif [[ "$sdkman_beta_channel" == "true" ]]; then
export sdkman_debug_mode
__sdkman_secure_curl "${SDKMAN_CANDIDATES_API}/selfupdate/beta" | bash
else
export sdkman_debug_mode
__sdkman_secure_curl "${SDKMAN_CANDIDATES_API}/selfupdate" | bash
__sdkman_secure_curl "${SDKMAN_CANDIDATES_API}/selfupdate/stable" | bash
fi
unset SDKMAN_FORCE_SELFUPDATE
}
function __sdkman_auto_update() {
@@ -57,7 +58,7 @@ function __sdkman_auto_update() {
fi
if [[ "$upgrade" == "Y" || "$upgrade" == "y" ]]; then
__sdk_selfupdate
__sdk_selfupdate "force"
unset upgrade
else
__sdkman_echo_no_colour "Not upgrading today..."

View File

@@ -17,7 +17,8 @@ And(~'^the default "([^"]*)" version is "([^"]*)"$') { String candidate, String
}
And(~'^an available selfupdate$') { ->
primeEndpointWithString("/selfupdate", 'echo "Successfully upgraded SDKMAN."')
primeEndpointWithString("/selfupdate/stable", 'echo "Successfully upgraded SDKMAN."')
primeEndpointWithString("/selfupdate/beta", 'echo "Successfully upgraded SDKMAN."')
}
And(~'^the candidate "([^"]*)" version "([^"]*)" is available for download$') { String candidate, String version ->