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 $ _dotenv_read_answer() { echo 'y' }
14 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env (glob)
16 **********************************************
20 **********************************************
22 Would you like to authorize it? [y/N]
26 Leave the directory and answer "no".
28 $ _dotenv_read_answer() { echo 'n' }
30 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env.leave (glob)
32 **********************************************
36 **********************************************
38 Would you like to authorize it? [y/N]
43 $ _dotenv_read_answer() { echo 'y' }
45 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env.leave (glob)
47 **********************************************
51 **********************************************
53 Would you like to authorize it? [y/N]
57 Now check with subdirs, looking upwards.
59 $ DOTENV_LOOK_UPWARDS=1
69 Now check with subdirs, not looking at parent dirs.
71 $ DOTENV_LOOK_UPWARDS=0
80 Test that .env is sourced only once with DOTENV_HANDLE_LEAVE=0.
82 $ unset _dotenv_stack_entered
83 $ DOTENV_HANDLE_LEAVE=0