# Internal functions. {{{
# Internal: stack of entered (and handled) directories. {{{
typeset -g -a _autoenv_stack_entered
-_autoenv_stack_entered=()
# -g: make it global, this is required when used with antigen.
typeset -g -A _autoenv_stack_entered_mtime
-_autoenv_stack_entered_mtime=()
# Add an entry to the stack, and remember its mtime.
_autoenv_stack_entered_add() {
AUTOENV_DEBUG=0
-source "$TESTDIR/../autoenv.plugin.zsh"
export AUTOENV_ENV_FILENAME="$PWD/.env_auth"
echo -n > $AUTOENV_ENV_FILENAME
Lets also try one more time to ensure it didn't add it.
+ $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
$ cd .
Attempting to load unauthorized env file!
-* /tmp/cramtests-*/autoenv.t/.env (glob)
**********************************************
- Would you like to authorize it? (type 'yes') no
+ Would you like to authorize it? (type 'yes') yes
+ ENTERED
+
+Reloading the script should keep the current state, e.g. when reloading your
+~/.zshrc.
+
+ $ source $TEST_AUTOENV_PLUGIN_FILE
+ $ cd .
_save_errexit=${options[errexit]}
set -e
+TEST_AUTOENV_PLUGIN_FILE="$TESTDIR/../autoenv.plugin.zsh"
+source $TEST_AUTOENV_PLUGIN_FILE
+
# Reset any authentication.
echo -n >| $AUTOENV_ENV_FILENAME