File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -139,19 +139,27 @@ function sdk() {
139139 # Store the return code of the requested command
140140 local final_rc=0
141141
142- # Execute the requested command
142+ # Native commands found under libexec
143143 local native_command=" ${SDKMAN_DIR} /libexec/${COMMAND} "
144144
145145 # Internal commands use underscores rather than hyphens
146146 local converted_command_name=$( echo " $COMMAND " | tr ' -' ' _' )
147147
148148 if [ -f " $native_command " ]; then
149- # It's available as a native binary
150- " $native_command " " $QUALIFIER " " $3 " " $4 "
149+ # Available as native command
150+ if [ -z " $QUALIFIER " ]; then
151+ " $native_command "
152+ elif [ -z " $3 " ]; then
153+ " $native_command " " $QUALIFIER "
154+ elif [ -z " $4 " ]; then
155+ " $native_command " " $QUALIFIER " " $3 "
156+ else
157+ " $native_command " " $QUALIFIER " " $3 " " $4 "
158+ fi
159+ final_rc=$?
151160
152161 elif [ -n " $CMD_FOUND " ]; then
153-
154- # It's available as a shell function
162+ # Available as a shell function
155163 __sdk_" $converted_command_name " " $QUALIFIER " " $3 " " $4 "
156164 final_rc=$?
157165 fi
You can’t perform that action at this time.
0 commit comments