Skip to content

Commit e0fc969

Browse files
author
helpermethod
committed
Migrate deprecated sdkman_selfupdate_enable configuration
1 parent cf52e4e commit e0fc969

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

app/views/install_beta.scala.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ else
230230
echo "sdkman_auto_complete=true" >> "$sdkman_config_file"
231231
fi
232232
echo "sdkman_auto_env=false" >> "$sdkman_config_file"
233+
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
233234
echo "sdkman_beta_channel=true" >> "$sdkman_config_file"
234235
echo "sdkman_checksum_enable=true" >> "$sdkman_config_file"
235236
echo "sdkman_colour_enable=true" >> "$sdkman_config_file"
@@ -238,7 +239,6 @@ echo "sdkman_curl_max_time=10" >> "$sdkman_config_file"
238239
echo "sdkman_debug_mode=false" >> "$sdkman_config_file"
239240
echo "sdkman_insecure_ssl=false" >> "$sdkman_config_file"
240241
echo "sdkman_rosetta2_compatible=false" >> "$sdkman_config_file"
241-
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
242242
echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file"
243243

244244
echo "Download script archive..."

app/views/install_stable.scala.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ echo "sdkman_curl_max_time=10" >> "$sdkman_config_file"
237237
echo "sdkman_debug_mode=false" >> "$sdkman_config_file"
238238
echo "sdkman_insecure_ssl=false" >> "$sdkman_config_file"
239239
echo "sdkman_rosetta2_compatible=false" >> "$sdkman_config_file"
240-
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
241-
echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file"
240+
echo "sdkman_selfupdate_enable=true" >> "$sdkman_config_file"
242241

243242
echo "Download script archive..."
244243
curl --location --progress-bar "${SDKMAN_SERVICE}/broker/download/sdkman/install/${SDKMAN_VERSION}/${SDKMAN_PLATFORM}" > "$sdkman_zip_file"

app/views/selfupdate_beta.scala.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_debug_mode') ]]; then
140140
echo "sdkman_debug_mode=true" >> "$sdkman_config_file"
141141
fi
142142

143-
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_selfupdate_enable|sdkman_auto_update') ]]; then
144-
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
145-
fi
146-
147143
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_env') ]]; then
148144
echo "sdkman_auto_env=false" >> "$sdkman_config_file"
149145
fi
@@ -168,6 +164,13 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_complete') ]]; then
168164
fi
169165
fi
170166

167+
# migrate deprecated sdkman_selfupdate_enable configuration
168+
sed -i.bak -e 's/sdkman_selfupdate_enable/sdkman_auto_update/' "$sdkman_config_file" && rm "${sdkman_config_file}.bak"
169+
170+
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_update') ]]; then
171+
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
172+
fi
173+
171174
# drop version token
172175
echo "$SDKMAN_VERSION" > "${SDKMAN_DIR}/var/version"
173176

app/views/selfupdate_stable.scala.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_answer') ]]; then
116116
echo "sdkman_auto_answer=false" >> "$sdkman_config_file"
117117
fi
118118

119-
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_selfupdate_enable|sdkman_auto_update') ]]; then
120-
echo "sdkman_auto_update=true" >> "$sdkman_config_file"
119+
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_selfupdate_enable') ]]; then
120+
echo "sdkman_selfupdate_enable=true" >> "$sdkman_config_file"
121121
fi
122122

123123
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_insecure_ssl') ]]; then
@@ -152,10 +152,6 @@ if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_rosetta2_compatible') ]]; th
152152
echo "sdkman_rosetta2_compatible=false" >> "$sdkman_config_file"
153153
fi
154154

155-
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_selfupdate_feature') ]]; then
156-
echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file"
157-
fi
158-
159155
if [[ -z $(cat ${sdkman_config_file} | grep 'sdkman_auto_complete') ]]; then
160156
if [ -z "$ZSH_VERSION" -a -z "$BASH_VERSION" ]; then
161157
echo "sdkman_auto_complete=false" >> "$sdkman_config_file"

0 commit comments

Comments
 (0)