Fix return value of _autoenv_source; use ': $(( .. ))'

`(( foo++ ))` returns an error in case $foo is not defined.
This commit is contained in:
Daniel Hahler 2015-04-23 14:39:36 +02:00
parent 9a010cbdf6
commit 8763a5b627
1 changed files with 3 additions and 3 deletions

View File

@ -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++ ))
}
# }}}