1 Ensure we have our mocked out ENV_AUTHORIZATION_FILE
3 $ [[ $ENV_AUTHORIZATION_FILE[0,4] == '/tmp' ]] || return 1
6 Lets set a simple .env action
10 $ echo 'echo ENTERED' >> .env
11 $ echo 'echo LEFT' >> .env.leave
13 Change to the directory.
15 $ _dotenv_read_answer() { echo 'y' }
17 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env (glob)
19 **********************************************
23 **********************************************
25 Would you like to authorize it? [y/N]
29 Leave the directory and answer "no".
31 $ _dotenv_read_answer() { echo 'n' }
33 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env.leave (glob)
35 **********************************************
39 **********************************************
41 Would you like to authorize it? [y/N]
46 $ _dotenv_read_answer() { echo 'y' }
48 Attempting to load unauthorized env file: /tmp/cramtests-??????/leave.t/sub/.env.leave (glob)
50 **********************************************
54 **********************************************
56 Would you like to authorize it? [y/N]
60 Now check with subdirs, looking upwards.
62 $ DOTENV_LOOK_UPWARDS=1
72 Now check with subdirs, not looking at parent dirs.
74 $ DOTENV_LOOK_UPWARDS=0