1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-12-22 10:50:16 +02:00

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

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