Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Completions should use custom install location #48

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions completions/sdk.fish
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ end
# # # # # #

function __fish_sdkman_candidates
cat "$HOME"/.sdkman/var/candidates | tr ',' '\n'
cat "$SDKMAN_DIR"/var/candidates | string replace -a -r ',' '\n'
end

function __fish_sdkman_candidates_with_versions
set regexpHome (string replace -a '/' '\\/' "$HOME/")

find "$HOME"/.sdkman/candidates/ -mindepth 2 -maxdepth 2 -name '*current' \
find "$SDKMAN_DIR"/candidates/ -mindepth 2 -maxdepth 2 -name '*current' \
| awk -F '/' '{ print $(NF-1) }' \
| sort -u
end

function __fish_sdkman_installed_versions
set cmd (commandline -opc)
if [ -d "$HOME"/.sdkman/candidates/$cmd[3]/current ]
ls -v1 "$HOME"/.sdkman/candidates/$cmd[3] | grep -v current
if [ -d "$SDKMAN_DIR"/candidates/$cmd[3]/current ]
ls -v1 "$SDKMAN_DIR"/candidates/$cmd[3] | grep -v current
end
end

Expand Down
Loading