-# Enable debugging. Multiple levels are supported (max 2).
-: ${AUTOENV_DEBUG:=0}
-
-# Public helper functions, which can be used from your .env files:
-#
-# Source the next .env file from parent directories.
-# This is useful if you want to use a base .env file for a directory subtree.
-autoenv_source_parent() {
- local parent_env_file=$(_autoenv_get_file_upwards $PWD)
-
- 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
- fi
-}
-
-# Internal functions. {{{
-# Internal: stack of entered (and handled) directories. {{{
-_autoenv_stack_entered=()
-typeset -A _autoenv_stack_entered_mtime
-_autoenv_stack_entered_mtime=()
-
-# Add an entry to the stack, and remember its mtime.
-_autoenv_stack_entered_add() {
- local env_file=$1
+typeset -a _autoenv_stack_entered
+typeset -A _autoenv_stack_entered_ctime
+typeset -a _autoenv_ctime