[chruby] adhere to the style guide

noted in the review: https://github.com/robbyrussell/oh-my-zsh/pull/5562/files#r94311319
This commit is contained in:
Michal Cichra 2017-01-02 14:04:51 +01:00
commit 98721878fb
No known key found for this signature in database
GPG key ID: 8F4BAE64224DE335

View file

@ -43,19 +43,19 @@ _source_from_omz_settings() {
zstyle -s :omz:plugins:chruby path _chruby_path
zstyle -s :omz:plugins:chruby auto _chruby_auto
if [[ -r "${_chruby_path}" ]]; then
source "${_chruby_path}"
if [[ -r "$_chruby_path" ]]; then
source "$_chruby_path"
fi
if [[ -r "${_chruby_auto}" ]]; then
source "${_chruby_auto}"
if [[ -r "$_chruby_auto" ]]; then
source "$_chruby_auto"
fi
}
function () {
local _chruby_homebrew_prefix="$(brew --prefix chruby) &> /dev/null"
if _homebrew-installed && [ -r "${_chruby_homebrew_prefix}" ] ; then
if _homebrew-installed && [[ -r "$_chruby_homebrew_prefix" ]] ; then
source "${_chruby_homebrew_prefix}/share/chruby/chruby.sh"
source "${_chruby_homebrew_prefix}/share/chruby/auto.sh"
elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then
@ -72,8 +72,8 @@ function ensure_chruby() {
function current_ruby() {
local _ruby="$(chruby | grep \* | tr -d '* ')"
if [[ -n "${_ruby}" ]]; then
echo "${_ruby}"
if [[ -n "$_ruby" ]]; then
echo "$_ruby"
else
echo "system"
fi