Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions conf.d/rbenv.fish
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
if not command -s rbenv > /dev/null
echo "rbenv: command not found. See https://github.com/rbenv/rbenv"
echo "Install <github.com/rbenv/rbenv> to use 'rbenv'."
exit 1
end

set -l rbenv_root ''
set -l rbenv_root ""

if test -z "$RBENV_ROOT"
set rbenv_root "$HOME/.rbenv"
set -x RBENV_ROOT "$HOME/.rbenv"
set rbenv_root ~/.rbenv
set -x RBENV_ROOT "$rbenv_root"
else
set rbenv_root "$RBENV_ROOT"
end

set -x PATH $rbenv_root/shims $PATH
set -x RBENV_SHELL fish
if test ! -d "$rbenv_root/shims"; or test ! -d "$rbenv_root/versions"
command mkdir -p $rbenv_root/{shims,versions}
if status --is-login
set -x PATH "$rbenv_root/shims" $PATH
set -x RBENV_SHELL fish
end
command mkdir -p "$rbenv_root/"{shims,versions}

4 changes: 2 additions & 2 deletions functions/rbenv.fish
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function rbenv
set -e argv[1]

switch "$command"
case rehash shell
source (rbenv "sh-$command" $argv|psub)
case (command rbenv commands --sh)
source (command rbenv "sh-$command" $argv|psub)
case '*'
command rbenv "$command" $argv
end
Expand Down