Unverified Commit 10ab2911 authored by Andrea Nanni's avatar Andrea Nanni Committed by GitHub
Browse files

sdk: add support for local versions and optimize sed calls (#7870)



* Added support for local sdk versions

Added support for local versions (prefixed by '+'), so they are filtered out in _listInstallableVersions() and they are displayed correctly by _listAllVersion()

* Optimize sed calls
Co-authored-by: default avatarMarc Cornellà <marc.cornella@live.com>
parent 72707d92
...@@ -51,12 +51,13 @@ _listInstalledVersions() { ...@@ -51,12 +51,13 @@ _listInstalledVersions() {
} }
_listInstallableVersions() { _listInstallableVersions() {
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \ # Remove local (+) and installed (*) versions from the list
sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*" __sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[+*] [^ ]\+//g;s/>//g'
} }
_listAllVersion() { _listAllVersion() {
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g" # Remove (*), (+), and (>) characters from the list
__sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[*+>] //g'
} }
_sdk () { _sdk () {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment