304e8f048059b5a71a8f561c039f3470a65c03db

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3338 from eripa/chruby_fix

Fix chruby plugin to not complain if chruby is *not* installed

Diff

 1diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
 2index 2a2c80cf67e637fada84a931134debb3e5f1df15..b461b0c9be7d5b39a27ebc7d646e93434e57e15a 100644
 3--- a/plugins/chruby/chruby.plugin.zsh
 4+++ b/plugins/chruby/chruby.plugin.zsh
 5@@ -24,7 +24,7 @@ _homebrew-installed() {
 6 }
 7 
 8 _chruby-from-homebrew-installed() {
 9-    brew --prefix chruby &> /dev/null
10+  [ -r $(brew --prefix chruby)] &> /dev/null
11 }
12 
13 _ruby-build_installed() {
14@@ -45,11 +45,11 @@ _source_from_omz_settings() {
15     zstyle -s :omz:plugins:chruby path _chruby_path
16     zstyle -s :omz:plugins:chruby auto _chruby_auto
17 
18-    if _chruby_path && [[ -r _chruby_path ]]; then
19+    if ${_chruby_path} && [[ -r ${_chruby_path} ]]; then
20         source ${_chruby_path}
21     fi
22 
23-    if _chruby_auto && [[ -r _chruby_auto ]]; then
24+    if ${_chruby_auto} && [[ -r ${_chruby_auto} ]]; then
25         source ${_chruby_auto}
26     fi
27 }