mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-01-30 17:23:02 -05:00
Disable candidate list when offline.
This commit is contained in:
@@ -68,7 +68,11 @@ function __sdkman_list {
|
||||
}
|
||||
|
||||
function __sdkman_list_candidates {
|
||||
echo "$(curl -s "${SDKMAN_SERVICE}/candidates/list")" | ${PAGER-less}
|
||||
if [[ "${SDKMAN_AVAILABLE}" == "false" ]]; then
|
||||
echo "This command is not available while offline."
|
||||
else
|
||||
echo "$(curl -s "${SDKMAN_SERVICE}/candidates/list")" | ${PAGER-less}
|
||||
fi
|
||||
}
|
||||
|
||||
function __sdkman_list_versions {
|
||||
|
||||
@@ -4,7 +4,7 @@ Feature: Service Unavailable
|
||||
Given the internet is not reachable
|
||||
And an initialised environment
|
||||
|
||||
# list command
|
||||
# list commands
|
||||
|
||||
Scenario: List candidate versions found while Offline
|
||||
Given the candidate "grails" version "2.1.0" is already installed and default
|
||||
@@ -21,6 +21,11 @@ Feature: Service Unavailable
|
||||
Then I see "Offline: only showing installed grails versions"
|
||||
And I see "None installed!"
|
||||
|
||||
Scenario: List Available Candidates while Offline
|
||||
Given the system is bootstrapped
|
||||
When I enter "sdk list"
|
||||
Then I see "This command is not available while offline."
|
||||
|
||||
# use command
|
||||
|
||||
Scenario: Use the default candidate version while Offline
|
||||
|
||||
Reference in New Issue
Block a user