mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 05:17:11 -07:00
fix: Completions use custom install location
Also, replace calls to `tr` with fish built-in
This commit is contained in:
parent
9363426857
commit
5f2ae91d5f
2 changed files with 10 additions and 4 deletions
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
|
||||||
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
- Completions use custom SDKMAN! install path (#48; thanks, @Bryan2333!)
|
||||||
|
|
||||||
## [2.0.0] - 2023-06-27
|
## [2.0.0] - 2023-06-27
|
||||||
|
|
||||||
### Breaking
|
### Breaking
|
||||||
|
|
|
@ -60,21 +60,21 @@ end
|
||||||
# # # # # #
|
# # # # # #
|
||||||
|
|
||||||
function __fish_sdkman_candidates
|
function __fish_sdkman_candidates
|
||||||
cat "$HOME"/.sdkman/var/candidates | tr ',' '\n'
|
cat "$SDKMAN_DIR"/var/candidates | string replace -a -r ',' '\n'
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_sdkman_candidates_with_versions
|
function __fish_sdkman_candidates_with_versions
|
||||||
set regexpHome (string replace -a '/' '\\/' "$HOME/")
|
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) }' \
|
| awk -F '/' '{ print $(NF-1) }' \
|
||||||
| sort -u
|
| sort -u
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_sdkman_installed_versions
|
function __fish_sdkman_installed_versions
|
||||||
set cmd (commandline -opc)
|
set cmd (commandline -opc)
|
||||||
if [ -d "$HOME"/.sdkman/candidates/$cmd[3]/current ]
|
if [ -d "$SDKMAN_DIR"/candidates/$cmd[3]/current ]
|
||||||
ls -v1 "$HOME"/.sdkman/candidates/$cmd[3] | grep -v current
|
ls -v1 "$SDKMAN_DIR"/candidates/$cmd[3] | grep -v current
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue