Compare commits
2 Commits
ba1ac41f60
...
47ac25f0de
Author | SHA1 | Date | |
---|---|---|---|
47ac25f0de | |||
320cc2ed13 |
@ -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
|
||||||
|
|
||||||
|
@ -10,22 +10,29 @@
|
|||||||
# Account for custom install locations
|
# Account for custom install locations
|
||||||
if set -q __sdkman_custom_dir
|
if set -q __sdkman_custom_dir
|
||||||
set -gx SDKMAN_DIR "$__sdkman_custom_dir"
|
set -gx SDKMAN_DIR "$__sdkman_custom_dir"
|
||||||
else
|
end
|
||||||
# This is the default location:
|
# 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"
|
set -gx SDKMAN_DIR "$HOME/.sdkman"
|
||||||
end
|
end
|
||||||
|
|
||||||
set __fish_sdkman_init "$SDKMAN_DIR/bin/sdkman-init.sh"
|
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
|
# Guard: SDKMAN! needs to be installed
|
||||||
if not test -f "$__fish_sdkman_init"
|
if not test -f "$__fish_sdkman_init"
|
||||||
exit 0
|
exit 0
|
||||||
end
|
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:
|
# Hack for issue #19:
|
||||||
# Create version of sdkman-init that doesn't export any environment variables.
|
# Create version of sdkman-init that doesn't export any environment variables.
|
||||||
# Refresh if sdkman-init changed.
|
# Refresh if sdkman-init changed.
|
||||||
|
@ -2,4 +2,4 @@ jorgebucaran/fisher
|
|||||||
jorgebucaran/nvm.fish
|
jorgebucaran/nvm.fish
|
||||||
jorgebucaran/replay.fish
|
jorgebucaran/replay.fish
|
||||||
lilyball/nix-env.fish
|
lilyball/nix-env.fish
|
||||||
reitzig/sdkman-for-fish@v2.0.0
|
reitzig/sdkman-for-fish@v2.1.0
|
||||||
|
@ -3,7 +3,7 @@ function _nvm_index_update
|
|||||||
|
|
||||||
set --local index $nvm_data/.index
|
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
|
command rm -f $index.temp
|
||||||
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
|
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
|
||||||
return 1
|
return 1
|
||||||
|
@ -29,7 +29,7 @@ function nvm --description "Node version manager"
|
|||||||
|
|
||||||
switch "$cmd"
|
switch "$cmd"
|
||||||
case -v --version
|
case -v --version
|
||||||
echo "nvm, version 2.2.13"
|
echo "nvm, version 2.2.14"
|
||||||
case "" -h --help
|
case "" -h --help
|
||||||
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
||||||
echo " nvm install Install the version specified in the nearest .nvmrc file"
|
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"
|
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
|
||||||
end
|
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 tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
|
||||||
command rm -rf $nvm_data/$ver
|
command rm -rf $nvm_data/$ver
|
||||||
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user