Skip to content

Commit 3682db3

Browse files
committed
Improve wording of upgrade command.
1 parent 97f166c commit 3682db3

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/main/bash/sdkman-upgrade.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function __sdk_upgrade() {
4848
;;
4949
*)
5050
if [ -n "$upgradable" ]; then
51-
[ ${upgradable_count} -eq 0 ] && __sdkman_echo_no_colour "Upgrade:"
51+
[ ${upgradable_count} -eq 0 ] && __sdkman_echo_no_colour "Available defaults:"
5252
__sdkman_echo_no_colour "$upgradable"
5353
((upgradable_count += 1))
5454
upgradable_candidates=(${upgradable_candidates[@]} $candidate)
@@ -72,7 +72,7 @@ function __sdk_upgrade() {
7272
echo ""
7373

7474
if [[ "$sdkman_auto_answer" != 'true' ]]; then
75-
__sdkman_echo_confirm "Upgrade candidate(s) and set latest version(s) as default? (Y/n): "
75+
__sdkman_echo_confirm "Upgrade to latest default version(s)? (Y/n): "
7676
read UPGRADE_ALL
7777
fi
7878

@@ -110,6 +110,6 @@ function __sdkman_determine_upgradable_version() {
110110

111111
# Check upgradable or not
112112
if [ ! -d "${SDKMAN_CANDIDATES_DIR}/${candidate}/${remote_default_version}" ]; then
113-
__sdkman_echo_yellow "${candidate} (${local_versions} < ${remote_default_version})"
113+
__sdkman_echo_yellow "${candidate} (local: ${local_versions}; default: ${remote_default_version})"
114114
fi
115115
}

src/test/resources/features/mnemonics.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Feature: Mnemonics
3838
And the default "grails" version is "2.4.4"
3939
And the system is bootstrapped
4040
When I enter "sdk ug grails" and answer "n"
41-
Then I see "Upgrade:"
42-
And I see "grails (1.3.9 < 2.4.4)"
41+
Then I see "Available defaults:"
42+
And I see "grails (local: 1.3.9; default: 2.4.4)"
4343

4444
Scenario: Shortcut for installing a Candidate Version
4545
Given the candidate "grails" version "2.1.0" is not installed

src/test/resources/features/upgrade_candidate.feature

+23-23
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Feature: Upgrade Candidate
1010
And the default "grails" version is "2.4.4"
1111
And the system is bootstrapped
1212
When I enter "sdk upgrade grails" and answer "n"
13-
Then I see "Upgrade:"
14-
And I see "grails (1.3.9 < 2.4.4)"
13+
Then I see "Available defaults:"
14+
And I see "grails (local: 1.3.9; default: 2.4.4)"
1515

1616
Scenario: Display upgradable candidate version in use when it is not upgradable
1717
Given the candidate "grails" version "1.3.9" is already installed and default
@@ -37,8 +37,8 @@ Feature: Upgrade Candidate
3737
And the default "grails" version is "2.4.4"
3838
And the system is bootstrapped
3939
When I enter "sdk upgrade" and answer "n"
40-
Then I see "Upgrade:"
41-
And I see "grails (1.3.9 < 2.4.4)"
40+
Then I see "Available defaults:"
41+
And I see "grails (local: 1.3.9; default: 2.4.4)"
4242

4343
Scenario: Display upgradable candidate versions when none is specified and multiple are in use
4444
Given the candidate "grails" version "1.3.9" is already installed and default
@@ -47,9 +47,9 @@ Feature: Upgrade Candidate
4747
And the default "groovy" version is "2.4.1"
4848
And the system is bootstrapped
4949
When I enter "sdk upgrade" and answer "n"
50-
Then I see "Upgrade:"
51-
And I see "grails (1.3.9 < 2.4.4)"
52-
And I see "groovy (2.0.5 < 2.4.1)"
50+
Then I see "Available defaults:"
51+
And I see "grails (local: 1.3.9; default: 2.4.4)"
52+
And I see "groovy (local: 2.0.5; default: 2.4.1)"
5353

5454
Scenario: Display upgradable candidate versions when none specified and multiple in use but not upgradable
5555
Given the candidate "grails" version "1.3.9" is already installed and default
@@ -69,10 +69,10 @@ Feature: Upgrade Candidate
6969
And the candidate "groovy" version "2.4.1" is available for download
7070
And the system is bootstrapped
7171
When I enter "sdk upgrade" and answer "Y"
72-
Then I see "Upgrade:"
73-
And I see "grails (1.3.9 < 2.1.0)"
74-
And I see "groovy (2.0.5 < 2.4.1)"
75-
And I see "Upgrade candidate(s) and set latest version(s) as default? (Y/n)"
72+
Then I see "Available defaults:"
73+
And I see "grails (local: 1.3.9; default: 2.1.0)"
74+
And I see "groovy (local: 2.0.5; default: 2.4.1)"
75+
And I see "Upgrade to latest default version(s)? (Y/n)"
7676
And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)"
7777
And I see "Setting grails 2.1.0 as default."
7878
And I do not see "Do you want groovy 2.4.1 to be set as default? (Y/n)"
@@ -86,9 +86,9 @@ Feature: Upgrade Candidate
8686
And the candidate "grails" version "2.1.0" is available for download
8787
And the system is bootstrapped
8888
When I enter "sdk upgrade" and answer "N"
89-
Then I see "Upgrade:"
90-
And I see "grails (1.3.9 < 2.1.0)"
91-
And I see "Upgrade candidate(s) and set latest version(s) as default? (Y/n)"
89+
Then I see "Available defaults:"
90+
And I see "grails (local: 1.3.9; default: 2.1.0)"
91+
And I see "Upgrade to latest default version(s)? (Y/n)"
9292
Then the candidate "grails" version "1.3.9" should be the default
9393

9494
Scenario: Update upgradable candidate version and set it as default
@@ -97,9 +97,9 @@ Feature: Upgrade Candidate
9797
And the candidate "grails" version "2.1.0" is available for download
9898
And the system is bootstrapped
9999
When I enter "sdk upgrade grails" and answer "Y"
100-
Then I see "Upgrade:"
101-
And I see "grails (1.3.9 < 2.1.0)"
102-
And I see "Upgrade candidate(s) and set latest version(s) as default? (Y/n): "
100+
Then I see "Available defaults:"
101+
And I see "grails (local: 1.3.9; default: 2.1.0)"
102+
And I see "Upgrade to latest default version(s)? (Y/n): "
103103
And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)"
104104
And I see "Setting grails 2.1.0 as default."
105105
Then the candidate "grails" version "2.1.0" should be the default
@@ -111,9 +111,9 @@ Feature: Upgrade Candidate
111111
And I have configured "sdkman_auto_answer" to "true"
112112
And the system is bootstrapped
113113
When I enter "sdk upgrade grails"
114-
Then I see "Upgrade:"
115-
And I see "grails (1.3.9 < 2.1.0)"
116-
And I do not see "Upgrade candidate(s) and set latest version(s) as default? (Y/n): "
114+
Then I see "Available defaults:"
115+
And I see "grails (local: 1.3.9; default: 2.1.0)"
116+
And I do not see "Upgrade to latest default version(s)? (Y/n): "
117117
And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)"
118118
And I see "Setting grails 2.1.0 as default."
119119
Then the candidate "grails" version "2.1.0" should be the default
@@ -124,7 +124,7 @@ Feature: Upgrade Candidate
124124
And the candidate "grails" version "2.1.0" is available for download
125125
And the system is bootstrapped
126126
When I enter "sdk upgrade grails" and answer "N"
127-
Then I see "Upgrade:"
128-
And I see "grails (1.3.9 < 2.1.0)"
129-
And I see "Upgrade candidate(s) and set latest version(s) as default? (Y/n)"
127+
Then I see "Available defaults:"
128+
And I see "grails (local: 1.3.9; default: 2.1.0)"
129+
And I see "Upgrade to latest default version(s)? (Y/n)"
130130
Then the candidate "grails" version "1.3.9" should be the default

0 commit comments

Comments
 (0)