aboutsummaryrefslogtreecommitdiff
path: root/.config/fish/conf.d/rvm.fish
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-11-15 20:16:31 +0800
committerGuangxiong Lin <[email protected]>2023-11-15 20:16:31 +0800
commit6ff0ddbfe3245043fb888c64d3425d7168c1695b (patch)
treecfd705ed75aa6e11d0e513d4e68ef905020043e4 /.config/fish/conf.d/rvm.fish
parent134d43fcab5fab0ee642ef9aef9988dc1cc151ff (diff)
downloaddotfiles-6ff0ddbfe3245043fb888c64d3425d7168c1695b.tar.gz
dotfiles-6ff0ddbfe3245043fb888c64d3425d7168c1695b.tar.bz2
dotfiles-6ff0ddbfe3245043fb888c64d3425d7168c1695b.zip
Add rvm into fisher
Diffstat (limited to '.config/fish/conf.d/rvm.fish')
-rw-r--r--.config/fish/conf.d/rvm.fish31
1 files changed, 31 insertions, 0 deletions
diff --git a/.config/fish/conf.d/rvm.fish b/.config/fish/conf.d/rvm.fish
new file mode 100644
index 0000000..0b00091
--- /dev/null
+++ b/.config/fish/conf.d/rvm.fish
@@ -0,0 +1,31 @@
+rvm current 1>/dev/null 2>&1
+
+function __check_rvm --on-variable PWD -d 'Setup rvm on directory change'
+ status --is-command-substitution; and return
+ if test "$rvm_project_rvmrc" != 0
+ set -l cwd $PWD
+ while true
+ if contains $cwd "" $HOME "/"
+ if test "$rvm_project_rvmrc_default" = 1
+ rvm default 1>/dev/null 2>&1
+ end
+ break
+ else
+ if begin
+ test -s ".rvmrc"
+ or test -s ".ruby-version"
+ or test -s ".ruby-gemset"
+ or test -s ".versions.conf"
+ or test -s "Gemfile"
+ end
+ rvm reload 1> /dev/null 2>&1
+ rvm rvmrc load 1>/dev/null 2>&1
+ break
+ else
+ set cwd (dirname "$cwd")
+ end
+ end
+ end
+ set -e cwd
+ end
+end