mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-04-20 15:07:06 -04:00
Source appropriate completion script if config enabled.
This commit is contained in:
@@ -153,7 +153,7 @@ if [[ -z "${sdkman_curl_retry_max_time}" ]]; then sdkman_curl_retry_max_time=60;
|
||||
# set curl to continue downloading automatically
|
||||
if [[ -z "${sdkman_curl_continue}" ]]; then sdkman_curl_continue=true; fi
|
||||
|
||||
# Read list of candidates and set array
|
||||
# read list of candidates and set array
|
||||
SDKMAN_CANDIDATES_CACHE="${SDKMAN_DIR}/var/candidates"
|
||||
SDKMAN_CANDIDATES_CSV=$(<"$SDKMAN_CANDIDATES_CACHE")
|
||||
__sdkman_echo_debug "Setting candidates csv: $SDKMAN_CANDIDATES_CSV"
|
||||
@@ -175,6 +175,19 @@ done
|
||||
unset candidate_name candidate_dir
|
||||
export PATH
|
||||
|
||||
# source completion scripts
|
||||
if [[ "$sdkman_auto_complete" == 'true' ]]; then
|
||||
if [[ "$zsh_shell" == 'true' ]]; then
|
||||
source "${SDKMAN_DIR}/contrib/completion/zsh/sdk"
|
||||
__sdkman_echo_debug "ZSH completion script loaded..."
|
||||
elif [[ "$bash_shell" == 'true' ]]; then
|
||||
source "${SDKMAN_DIR}/contrib/completion/bash/sdk"
|
||||
__sdkman_echo_debug "Bash completion script loaded..."
|
||||
else
|
||||
__sdkman_echo_debug "No completion scripts found for $SHELL"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$sdkman_auto_env" == "true" ]]; then
|
||||
if [[ "$zsh_shell" == "true" ]]; then
|
||||
function sdkman_auto_env() {
|
||||
|
||||
Reference in New Issue
Block a user