if [[ -n $parent_env_file ]] \
&& _autoenv_check_authorized_env_file $parent_env_file; then
_autoenv_debug "Calling autoenv_source_parent: parent_env_file:$parent_env_file"
-
- local parent_env_dir=${parent_env_file:A:h}
-
- _autoenv_stack_entered_add $parent_env_file
-
- _autoenv_source $parent_env_file enter $parent_env_dir
+ _autoenv_source $parent_env_file enter
fi
}
_autoenv_debug "== END SOURCE =="
builtin cd -q $new_dir
+ if [[ $autoenv_event == enter ]]; then
+ _autoenv_stack_entered_add $env_file
+ fi
+
# Unset vars set for enter/leave scripts.
# This should not get done for recursion (via autoenv_source_parent),
# and can be useful to have in general after autoenv was used.
return
fi
- _autoenv_stack_entered_add $env_file
-
# Source the enter env file.
_autoenv_debug "Sourcing from chpwd handler: $env_file"
_autoenv_source $env_file enter