Skip to content

Instantly share code, notes, and snippets.

@patorash

patorash/anyenv.fish

Last active Jul 15, 2019
Embed
What would you like to do?
fish and anyenv(rbenv, ndenv, goenv)
set -x PATH $HOME/.anyenv/bin $PATH
# eval (anyenv init - fish) # not working...
# rbenv
set -x RBENV_ROOT "$HOME/.anyenv/envs/rbenv"
set -x PATH $PATH "$RBENV_ROOT/bin"
set -gx PATH "$RBENV_ROOT/shims" $PATH
set -gx RBENV_SHELL fish
source "$RBENV_ROOT/libexec/../completions/rbenv.fish"
command rbenv rehash 2>/dev/null
function rbenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
source (rbenv "sh-$command" $argv|psub)
case '*'
command rbenv "$command" $argv
end
end
# ndenv
set -x NDENV_ROOT "$HOME/.anyenv/envs/ndenv"
set -x PATH $PATH "$NDENV_ROOT/bin"
set -gx PATH "$NDENV_ROOT/shims" $PATH
set -gx NDENV_SHELL fish
command ndenv rehash 2>/dev/null
function ndenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
eval (ndenv sh-"$command" $argv|psub)
case '*'
command ndenv "$command" $argv
end
end
# goenv
set -x GOENV_ROOT "$HOME/.anyenv/envs/goenv"
set -x PATH $PATH "$GOENV_ROOT/bin"
set -gx PATH "$GOENV_ROOT/shims" $PATH
set -gx GOENV_SHELL fish
source "$GOENV_ROOT/libexec/../completions/goenv.fish"
command goenv rehash 2>/dev/null
function goenv
set command $argv[1]
set -e argv[1]
switch "$command"
case rehash shell
source (goenv "sh-$command" $argv|psub)
case '*'
command goenv "$command" $argv
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.