From: Daniel Hahler Date: Thu, 23 Apr 2015 12:39:36 +0000 (+0200) Subject: Fix return value of _autoenv_source; use ': $(( .. ))' X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8763a5b627a9b4d93e3fc3dd66a819d6b1bde582;hp=9a010cbdf6d58d7c82a7e5000a9b116735ec1764;p=zsh-autoenv.git Fix return value of _autoenv_source; use ': $(( .. ))' `(( foo++ ))` returns an error in case $foo is not defined. --- diff --git a/autoenv.zsh b/autoenv.zsh index 05ac0b7..1a01c07 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -238,9 +238,9 @@ _autoenv_source() { # Change to directory of env file, source it and cd back. local new_dir=$PWD _autoenv_debug "== SOURCE: ${bold_color:-}$env_file${reset_color:-}\n PWD: $PWD" - (( _autoenv_debug_indent++ )) + : $(( _autoenv_debug_indent++ )) source $env_file - (( _autoenv_debug_indent-- )) + : $(( _autoenv_debug_indent-- )) _autoenv_debug "== END SOURCE ==" if [[ $autoenv_event == enter ]]; then @@ -337,7 +337,7 @@ _autoenv_chpwd_handler() { _autoenv_chpwd_prev_dir=$PWD - (( _autoenv_debug_indent++ )) + : $(( _autoenv_debug_indent++ )) } # }}}