You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add "shell" subcommand for setting versions in shell session
Add a "shell" command similar to the existing "global" and "local"
commands, which sets the version in an environment variable instead of
writing it to a file. This was inspired by the similar functionality in
rbenv.
It works by adding a wrapper function for the asdf command. It forwards
to a "sh-shell" command that returns the exports as shell code which is
then evaled by the wrapper. This is a little gross, but we need to run
the code in the shell context in order to set variables.
Resolvesasdf-vm#378
Copy file name to clipboardExpand all lines: completions/asdf.bash
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ _asdf () {
46
46
# shellcheck disable=SC2207
47
47
COMPREPLY=($(compgen -W "--head" -- "$cur"))
48
48
;;
49
-
uninstall|where|reshim|local|global)
49
+
uninstall|where|reshim|local|global|shell)
50
50
if [[ "$plugins"==*"$prev"* ]] ;then
51
51
local versions
52
52
versions=$(asdf list "$prev"2> /dev/null)
@@ -58,7 +58,7 @@ _asdf () {
58
58
fi
59
59
;;
60
60
*)
61
-
local cmds='current global help install list list-all local plugin-add plugin-list plugin-list-all plugin-remove plugin-update reshim uninstall update where which '
61
+
local cmds='current global help install list list-all local plugin-add plugin-list plugin-list-all plugin-remove plugin-update reshim shell uninstall update where which '
0 commit comments