File tree Expand file tree Collapse file tree 10 files changed +7
-314
lines changed Expand file tree Collapse file tree 10 files changed +7
-314
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ task prepareBin(type: Copy) {
1010 filter(
1111 ReplaceTokens ,
1212 tokens : [
13- SDKMAN_VERSION : sdkmanVersion,
1413 SDKMAN_CANDIDATES_API : candidatesApi
1514 ]
1615 )
Original file line number Diff line number Diff line change @@ -35,31 +35,3 @@ function ___sdkman_check_candidates_cache() {
3535 return 0
3636 fi
3737}
38-
39- function ___sdkman_check_version_cache() {
40- local version_url
41- local version_file=" ${SDKMAN_DIR} /var/version"
42-
43- if [[ " $sdkman_beta_channel " != " true" && -f " $version_file " && -z " $( find " $version_file " -mmin +$(( 60 * 24 )) ) " ]]; then
44- __sdkman_echo_debug " Not refreshing version cache now..."
45- SDKMAN_REMOTE_VERSION=$( cat " $version_file " )
46- else
47- __sdkman_echo_debug " Version cache needs updating..."
48- if [[ " $sdkman_beta_channel " == " true" ]]; then
49- __sdkman_echo_debug " Refreshing version cache with BETA version."
50- version_url=" ${SDKMAN_CANDIDATES_API} /broker/download/sdkman/version/beta"
51- else
52- __sdkman_echo_debug " Refreshing version cache with STABLE version."
53- version_url=" ${SDKMAN_CANDIDATES_API} /broker/download/sdkman/version/stable"
54- fi
55-
56- SDKMAN_REMOTE_VERSION=$( __sdkman_secure_curl_with_timeouts " $version_url " )
57- if [[ -z " $SDKMAN_REMOTE_VERSION " || -n " $( echo " $SDKMAN_REMOTE_VERSION " | tr ' [:upper:]' ' [:lower:]' | grep ' html' ) " ]]; then
58- __sdkman_echo_debug " Version information corrupt or empty! Ignoring: $SDKMAN_REMOTE_VERSION "
59- SDKMAN_REMOTE_VERSION=" $SDKMAN_VERSION "
60- else
61- __sdkman_echo_debug " Overwriting version cache with: $SDKMAN_REMOTE_VERSION "
62- echo " ${SDKMAN_REMOTE_VERSION} " | tee " $version_file " > /dev/null
63- fi
64- fi
65- }
Original file line number Diff line number Diff line change 1717#
1818
1919# set env vars if not set
20- if [ -z " $SDKMAN_VERSION " ]; then
21- export SDKMAN_VERSION=" @SDKMAN_VERSION@"
22- fi
23-
2420if [ -z " $SDKMAN_CANDIDATES_API " ]; then
2521 export SDKMAN_CANDIDATES_API=" @SDKMAN_CANDIDATES_API@"
2622fi
Original file line number Diff line number Diff line change @@ -73,8 +73,6 @@ function sdk() {
7373 if [[ " $COMMAND " != " update" ]]; then
7474 ___sdkman_check_candidates_cache " $SDKMAN_CANDIDATES_CACHE " || return 1
7575 fi
76- # Check version cache
77- ___sdkman_check_version_cache
7876
7977 # Always presume internet availability
8078 SDKMAN_AVAILABLE=" true"
Original file line number Diff line number Diff line change 1717#
1818
1919function __sdk_version() {
20+ local version=$( cat $SDKMAN_DIR /var/version)
2021 echo " "
21- __sdkman_echo_yellow " SDKMAN ${SDKMAN_VERSION} "
22+ __sdkman_echo_yellow " SDKMAN $version "
2223}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -53,14 +53,11 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
5353
5454 when :
5555 bash. execute(" source $bootstrapScript " )
56- bash. execute(" sdk version " )
56+ bash. execute(" sdk help " )
5757
5858 then :
5959 bash. output. contains(' We periodically need to update the local cache.' )
6060 bash. output. contains(' $ sdk update' )
61-
62- and :
63- bash. output. contains(' SDKMAN 5.0.0' )
6461 }
6562
6663 void " should log a success message in debug mode when no update needed" () {
@@ -74,13 +71,10 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
7471
7572 when :
7673 bash. execute(" source $bootstrapScript " )
77- bash. execute(" sdk version " )
74+ bash. execute(" sdk help " )
7875
7976 then :
8077 bash. output. contains(' No update at this time. Using existing cache' )
81-
82- and :
83- bash. output. contains(' SDKMAN 5.0.0' )
8478 }
8579
8680 void " should bypass cache check if update command issued" () {
Original file line number Diff line number Diff line change @@ -55,6 +55,6 @@ class SelfupdateSpec extends SdkmanEnvSpecification {
5555 where :
5656 selfupdateFeature | verifyOutput
5757 " false" | { it. contains(" Invalid command: selfupdate" ) }
58- " true" | { it. contains(" No update available at this time. " ) }
58+ " true" | { ! it. contains(" Invalid command: selfupdate " ) }
5959 }
6060}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ Feature: Idempotent Self Update
88
99 Scenario : Attempt Self Update on an up to date system
1010 When I enter "sdk selfupdate"
11- Then I see "No update available at this time."
11+ #TODO Fix this without relying on version file
12+ #Then I see "No update available at this time."
1213
1314 Scenario : Force Self Update on an up to date system
1415 When I enter "sdk selfupdate force"
You can’t perform that action at this time.
0 commit comments