asdf/asdf.fish

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
877 B
Fish
Raw Normal View History

if not set -q ASDF_DIR
set -x ASDF_DIR (dirname (status -f))
end
# Add asdf to PATH
# fish_add_path was added in fish 3.2, so we need a fallback for older version
if type -q fish_add_path
2020-08-12 06:12:22 -07:00
if test -n "$ASDF_DATA_DIR"
fish_add_path --global --move "$ASDF_DATA_DIR/shims" "$ASDF_DIR/bin"
2020-08-12 06:12:22 -07:00
else
fish_add_path --global --move "$HOME/.asdf/shims" "$ASDF_DIR/bin"
2020-08-12 06:12:22 -07:00
end
else
set -l asdf_user_shims (
if test -n "$ASDF_DATA_DIR"
printf "%s\n" "$ASDF_DATA_DIR/shims"
else
printf "%s\n" "$HOME/.asdf/shims"
end
)
2016-04-18 00:33:14 -07:00
set -l asdf_bin_dirs $ASDF_DIR/bin $asdf_user_shims
2016-04-18 00:33:14 -07:00
for x in $asdf_bin_dirs
if test -d $x
for i in (seq 1 (count $PATH))
if test $PATH[$i] = $x
set -e PATH[$i]
break
end
2019-07-22 16:44:32 -07:00
end
end
set PATH $x $PATH
2019-04-08 01:11:13 -07:00
end
end
# Load the asdf wrapper function
2021-05-21 09:03:06 -07:00
. $ASDF_DIR/lib/asdf.fish