Compare commits

..

2 Commits

Author SHA1 Message Date
47ac25f0de fish: bump nvm.fish to 2.2.14 2024-05-13 15:07:13 -05:00
320cc2ed13 java: bump sdkman-for-fish to v2.1.0 2024-05-13 15:06:16 -05:00
5 changed files with 21 additions and 14 deletions

View File

@ -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

View File

@ -10,22 +10,29 @@
# Account for custom install locations
if set -q __sdkman_custom_dir
set -gx SDKMAN_DIR "$__sdkman_custom_dir"
else
# This is the default location:
end
# Guard: SDKMAN! needs to be installed
if set -q SDKMAN_DIR; and not test -f "$SDKMAN_DIR/bin/sdkman-init.sh"
echo "WARNING: SDKMAN! installation path set to $SDKMAN_DIR, but no installation found there"
exit 0
end
# Unless overridden, use the default location:
if not set -q SDKMAN_DIR
set -gx SDKMAN_DIR "$HOME/.sdkman"
end
set __fish_sdkman_init "$SDKMAN_DIR/bin/sdkman-init.sh"
# Copied from https://github.com/jorgebucaran/fisher/blob/main/functions/fisher.fish to be consistent:
set --query fisher_path || set --local fisher_path $__fish_config_dir
set __fish_sdkman_noexport_init "$fisher_path/functions/__sdkman-noexport-init.sh"
# Guard: SDKMAN! needs to be installed
if not test -f "$__fish_sdkman_init"
exit 0
end
# Copied from https://github.com/jorgebucaran/fisher/blob/main/functions/fisher.fish to be consistent:
set --query fisher_path || set --local fisher_path $__fish_config_dir
set __fish_sdkman_noexport_init "$fisher_path/functions/__sdkman-noexport-init.sh"
# Hack for issue #19:
# Create version of sdkman-init that doesn't export any environment variables.
# Refresh if sdkman-init changed.

View File

@ -2,4 +2,4 @@ jorgebucaran/fisher
jorgebucaran/nvm.fish
jorgebucaran/replay.fish
lilyball/nix-env.fish
reitzig/sdkman-for-fish@v2.0.0
reitzig/sdkman-for-fish@v2.1.0

View File

@ -3,7 +3,7 @@ function _nvm_index_update
set --local index $nvm_data/.index
if not command curl --location --silent $nvm_mirror/index.tab >$index.temp
if not command curl -q --location --silent $nvm_mirror/index.tab >$index.temp
command rm -f $index.temp
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
return 1

View File

@ -29,7 +29,7 @@ function nvm --description "Node version manager"
switch "$cmd"
case -v --version
echo "nvm, version 2.2.13"
echo "nvm, version 2.2.14"
case "" -h --help
echo "Usage: nvm install <version> Download and activate the specified Node version"
echo " nvm install Install the version specified in the nearest .nvmrc file"
@ -113,7 +113,7 @@ function nvm --description "Node version manager"
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
end
if ! command curl $silent --progress-bar --location $url |
if ! command curl -q $silent --progress-bar --location $url |
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
command rm -rf $nvm_data/$ver
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2