mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 13:48:16 +08:00
RVM plugin
This commit is contained in:
parent
1e031c9621
commit
0b4755ea01
10
plugins/rvm/rvm.fish
Normal file
10
plugins/rvm/rvm.fish
Normal file
|
@ -0,0 +1,10 @@
|
|||
function rvm -d 'Ruby enVironment Manager'
|
||||
# run RVM and capture the resulting environment
|
||||
set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX)
|
||||
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
|
||||
|
||||
# apply rvm_* and *PATH variables from the captured environment
|
||||
and eval (grep '^rvm\|^[^=]*PATH' $env_file | sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//')
|
||||
# clean up
|
||||
rm -f $env_file
|
||||
end
|
Loading…
Reference in New Issue
Block a user