Skip to content

Commit

Permalink
Don't double-source chruby
Browse files Browse the repository at this point in the history
If chruby was installed using default way, most likely chruby and
auto-switching will be already sourced (at least on most Linuxes).
  • Loading branch information
RIT80 committed Feb 18, 2018
1 parent 16dccb4 commit b4ff6c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/ruby/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ elif (( $+commands[rbenv] )); then

# Load package manager installed chruby into the shell session.
elif (( $+commands[chruby-exec] )); then
source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
if (( ! $+functions[chruby] )); then
source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
fi

if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then
source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
if (( ! $+functions[chruby_auto] )); then
source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
fi

# If a default Ruby is set, switch to it.
chruby_auto
Expand Down

0 comments on commit b4ff6c6

Please sign in to comment.