gvm
gvm copied to clipboard
Fish shell support
Its would be great if u could add support for Fish shell
+1 :)
need too
Fish is a good shell, I think it should add support for it.
Anyone worked this out?
I've been using Bass as a way to get gvm
working in fish. I'm still working to get gvm use
to work, but I'll update this post when I do. It's pretty glitchy overall, but its working for now.
To setup, run the normal install command in bash:
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
Then, add gvm.fish
to your functions folder:
function gvm
bass source ~/.gvm/scripts/gvm ';' gvm $argv
end
You should be up and running!
+1
+1
@jadengore Yep, that's a workaround for people using fish :)
@egoist gvm use
still does not work for me, but it's something!
+1 - the regular shell makes me sad
+1 - the workaround has no persistent gvm use
between shell sessions.
+1 - gvm install
doesn't work for me using this method, I have to drop into bash
I add an file named gvm.fish
in ~/.config/fish/functions/
folder with:
function gvm
set after_env (mktemp -t env)
set path_env (mktemp -t env)
bash -c "source ~/.gvm/scripts/gvm && gvm $argv && printenv > $after_env"
# remove any pre-existing .gvm paths
for elem in $PATH
switch $elem
case '*/.gvm/*'
# ignore
case '*'
echo "$elem" >> $path_env
end
end
for env in (cat $after_env)
set env_name (echo $env | sed s/=.\*//)
set env_value (echo $env | sed s/.\*=//)
switch $env_name
case 'PATH'
for elem in (echo $env_value | tr ':' '\n')
switch $elem
case '*/.gvm/*'
echo "$elem" >> $path_env
end
end
case '*'
switch $env_value
case '*/.gvm/*'
eval set -g $env_name $env_value > /dev/null
end
end
end
set -gx PATH (cat $path_env) ^ /dev/null
rm -f $after_env
rm -f $path_env
end
And in my file ~/.config/fish/config.fish
I add the following line:
bass source ~/.gvm/environments/default
Its works for me!