From 8763a5b627a9b4d93e3fc3dd66a819d6b1bde582 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 23 Apr 2015 14:39:36 +0200 Subject: [PATCH] Fix return value of _autoenv_source; use ': $(( .. ))' `(( foo++ ))` returns an error in case $foo is not defined. --- autoenv.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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++ )) } # }}} -- 2.44.0