1 $ source $TESTDIR/setup.sh
3 Lets set a simple .env action
7 $ echo 'echo ENTERED' >> .env
8 $ echo 'echo LEFT' >> .env.leave
10 Change to the directory.
12 $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
14 Attempting to load unauthorized env file!
15 -* /tmp/cramtests-*/leave.t/sub/.env (glob)
17 **********************************************
21 **********************************************
23 Would you like to authorize it? (type 'yes') yes
27 Leave the directory and answer "no".
29 $ _autoenv_ask_for_yes() { echo "no"; return 1 }
31 Attempting to load unauthorized env file!
32 -* /tmp/cramtests-*/leave.t/sub/.env.leave (glob)
34 **********************************************
38 **********************************************
40 Would you like to authorize it? (type 'yes') no
45 $ _autoenv_ask_for_yes() { echo "yes"; return 0 }
47 Attempting to load unauthorized env file!
48 -* /tmp/cramtests-*/leave.t/sub/.env.leave (glob)
50 **********************************************
54 **********************************************
56 Would you like to authorize it? (type 'yes') yes
60 Now check with subdirs, looking upwards.
62 $ AUTOENV_LOOK_UPWARDS=1
72 Now check with subdirs, not looking at parent dirs.
74 $ AUTOENV_LOOK_UPWARDS=0
83 Test that .env is sourced only once with AUTOENV_HANDLE_LEAVE=0.
85 $ unset _autoenv_stack_entered
86 $ AUTOENV_HANDLE_LEAVE=0