From 87534a008ab3f7b13cc2aa3e316f60da006ea10a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 26 Apr 2017 20:12:30 -0700 Subject: [PATCH] Fix issues when RBENV_ROOT/version doesn't exist. Fixes #89 --- fish_prompt.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index c21bf03..6caf677 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -678,10 +678,11 @@ function __bobthefish_show_ruby -S -d 'Current Ruby (rvm/rbenv)' set -q RBENV_ROOT or set -l RBENV_ROOT $HOME/.rbenv - read -l global_ruby_version <$RBENV_ROOT/version + [ -e "$RBENV_ROOT/version" ] + and read -l global_ruby_version <"$RBENV_ROOT/version" [ "$global_ruby_version" ] - or set global_ruby_version system + or set -l global_ruby_version system [ "$ruby_version" = "$global_ruby_version" ]; and return else if type -q chruby