postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

System-wide configuration for zsh #270

Open bjoernalbers opened 10 years ago

bjoernalbers commented 10 years ago

chruby won't get sourced system-wide under zsh when using the README's config sample:

if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
  source /usr/local/share/chruby/chruby.sh
  ...
fi

I just learned that zsh ignores /etc/profile in favor of /etc/zshenv, so the config instructions might need to be updates. This worked for me on OS X:

# /etc/profile
if [ -n "$BASH_VERSION" ]; then
  source /usr/local/share/chruby/chruby.sh
  ...
fi

# /etc/zshenv
if [ -d /usr/local/share/chruby ]; then
  source /usr/local/share/chruby/chruby.sh
  ...
fi
postmodern commented 10 years ago

On Fedora Linux, /etc/zprofile will source /etc/profile (and thus /etc/profile.d/) with ksh emulation turned on.

bjoernalbers commented 10 years ago

@postmodern Thanks for the clarification. I didn't know that. Shall I update the pull request accordingly or do you want my to close this?