diff --git a/app/views/install_beta.scala.txt b/app/views/install_beta.scala.txt index 58ab4ce..ea9e410 100644 --- a/app/views/install_beta.scala.txt +++ b/app/views/install_beta.scala.txt @@ -230,6 +230,7 @@ else echo "sdkman_auto_complete=true" >> "$sdkman_config_file" fi echo "sdkman_auto_env=false" >> "$sdkman_config_file" +echo "sdkman_auto_update=true" >> "$sdkman_config_file" echo "sdkman_beta_channel=true" >> "$sdkman_config_file" echo "sdkman_checksum_enable=true" >> "$sdkman_config_file" echo "sdkman_colour_enable=true" >> "$sdkman_config_file" @@ -238,7 +239,7 @@ echo "sdkman_curl_max_time=10" >> "$sdkman_config_file" echo "sdkman_debug_mode=false" >> "$sdkman_config_file" echo "sdkman_insecure_ssl=false" >> "$sdkman_config_file" echo "sdkman_rosetta2_compatible=false" >> "$sdkman_config_file" -echo "sdkman_selfupdate_enable=true" >> "$sdkman_config_file" +echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file" echo "Download script archive..." curl --location --progress-bar "${SDKMAN_SERVICE}/broker/download/sdkman/install/${SDKMAN_VERSION}/${SDKMAN_PLATFORM}" > "$sdkman_zip_file" diff --git a/app/views/selfupdate_beta.scala.txt b/app/views/selfupdate_beta.scala.txt index 17694ac..e0da371 100644 --- a/app/views/selfupdate_beta.scala.txt +++ b/app/views/selfupdate_beta.scala.txt @@ -1,3 +1,4 @@ +@import java.time.LocalDate @(cliVersion: String, baseUrl: String)#!/bin/bash # # Copyright 2017 Marco Vermeulen @@ -156,6 +157,10 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_checksum_enable') ]]; then echo "sdkman_checksum_enable=true" >> "$sdkman_config_file" fi +if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_selfupdate_feature') ]]; then + echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file" +fi + if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_complete') ]]; then if [ -z "$ZSH_VERSION" -a -z "$BASH_VERSION" ]; then echo "sdkman_auto_complete=false" >> "$sdkman_config_file" @@ -164,6 +169,18 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_complete') ]]; then fi fi +# migrate deprecated sdkman_selfupdate_enable configuration +@defining(LocalDate.now()) { now => +cp "$sdkman_config_file" "${sdkman_config_file}-@{now}.bak" + +sed 's/sdkman_selfupdate_enable/sdkman_auto_update/' "$sdkman_config_file" > "${sdkman_config_file}.tmp" && + mv "${sdkman_config_file}.tmp" "$sdkman_config_file" +} + +if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_update') ]]; then + echo "sdkman_auto_update=true" >> "$sdkman_config_file" +fi + # drop version token echo "$SDKMAN_VERSION" > "${SDKMAN_DIR}/var/version"