mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-02-01 02:03:18 -05:00
Handle invalid candidate versions on server side.
This commit is contained in:
@@ -35,7 +35,7 @@ function determine_candidate_version {
|
||||
|
||||
if [ "$VERSION" == "invalid" ]; then
|
||||
echo ""
|
||||
echo "Stop! $1 is not a valid grails version."
|
||||
echo "Stop! $1 is not a valid $CANDIDATE version."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ rm.get("/candidates/:candidate") { req ->
|
||||
def candidate = req.params['candidate']
|
||||
def versions = buildCsv(candidates[candidate])?.toString()
|
||||
addPlainTextHeader req
|
||||
req.response.end (versions ?: "")
|
||||
req.response.end (versions ?: "invalid")
|
||||
}
|
||||
|
||||
rm.get("/candidates/:candidate/default") { req ->
|
||||
def candidate = req.params['candidate']
|
||||
addPlainTextHeader req
|
||||
req.response.end defaults[candidate]
|
||||
req.response.end (defaults[candidate] ?: "")
|
||||
}
|
||||
|
||||
rm.get("/candidates/:candidate/list") { req ->
|
||||
|
||||
Reference in New Issue
Block a user