File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,11 @@ function __sdkman_determine_current_version() {
5757 present=$( __sdkman_path_contains " ${SDKMAN_CANDIDATES_DIR} /${candidate} " )
5858 if [[ " $present " == ' true' ]]; then
5959 if [[ $PATH =~ ${SDKMAN_CANDIDATES_DIR} /${candidate} /([^/]+)/bin ]]; then
60- CURRENT=${BASH_REMATCH[1]}
60+ if [[ " $zsh_shell " == " true" ]]; then
61+ CURRENT=${match[1]}
62+ else
63+ CURRENT=${BASH_REMATCH[1]}
64+ fi
6165 fi
6266
6367 if [[ " $CURRENT " == " current" ]]; then
Original file line number Diff line number Diff line change @@ -38,7 +38,15 @@ function __sdk_use() {
3838 __sdkman_set_candidate_home " $candidate " " $version "
3939
4040 if [[ $PATH =~ ${SDKMAN_CANDIDATES_DIR} /${candidate} /([^/]+) ]]; then
41- export PATH=${PATH// ${SDKMAN_CANDIDATES_DIR} \/ ${candidate} \/ ${BASH_REMATCH[1]} / ${SDKMAN_CANDIDATES_DIR} \/ ${candidate} \/ ${version} }
41+ local matched_version
42+
43+ if [[ " $zsh_shell " == " true" ]]; then
44+ matched_version=${match[1]}
45+ else
46+ matched_version=${BASH_REMATCH[1]}
47+ fi
48+
49+ export PATH=${PATH// ${SDKMAN_CANDIDATES_DIR} \/ ${candidate} \/ ${matched_version} / ${SDKMAN_CANDIDATES_DIR} \/ ${candidate} \/ ${version} }
4250 fi
4351
4452 if [[ ! (-L " ${SDKMAN_CANDIDATES_DIR} /${candidate} /current" || -d " ${SDKMAN_CANDIDATES_DIR} /${candidate} /current" ) ]]; then
You can’t perform that action at this time.
0 commit comments