fi
local env_file="$PWD/$AUTOENV_FILE_ENTER"
- _autoenv_debug "env_file: $env_file"
+ _autoenv_debug "looking for env_file: $env_file"
# Handle leave event for previously sourced env files.
if [[ $AUTOENV_HANDLE_LEAVE == 1 ]] && (( $#_autoenv_stack_entered )); then
if ! [[ ${PWD}/ == ${prev_dir}/* ]]; then
local env_file_leave=$prev_dir/$AUTOENV_FILE_LEAVE
if _autoenv_check_authorized_env_file $env_file_leave; then
- _autoenv_source $env_file_leave leave $prev_dir
+ varstash_dir=$prev_dir _autoenv_source $env_file_leave leave $prev_dir
fi
# Unstash any autostashed stuff.
if ! [[ -f $env_file ]] && [[ $AUTOENV_LOOK_UPWARDS == 1 ]]; then
env_file=$(_autoenv_get_file_upwards $PWD)
if [[ -z $env_file ]]; then
+ _autoenv_debug "No env_file found when looking upwards"
return
fi
+ _autoenv_debug "Found env_file: $env_file"
fi
# Load the env file only once: check if $env_file is in the stack of entered