1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-26 00:40:59 +02:00

tests: setopt errexit during setup

This is meant to prevent accidentally overwriting your auth file when
running / changing the tests.
This commit is contained in:
Daniel Hahler 2015-03-15 22:16:12 +01:00
parent 15bc1e3c62
commit e8372e9cdf

View File

@ -14,6 +14,10 @@ if [[ $AUTOENV_ENV_FILENAME[0,4] != '/tmp' ]]; then
return 1 return 1
fi fi
# Abort this setup script on any error.
_save_errexit=${options[errexit]}
set -e
# Reset any authentication. # Reset any authentication.
echo -n >| $AUTOENV_ENV_FILENAME echo -n >| $AUTOENV_ENV_FILENAME
@ -27,3 +31,7 @@ test_autoenv_auth_env_files() {
test_autoenv_add_to_env $PWD/$AUTOENV_FILE_ENTER test_autoenv_add_to_env $PWD/$AUTOENV_FILE_ENTER
test_autoenv_add_to_env $PWD/$AUTOENV_FILE_LEAVE test_autoenv_add_to_env $PWD/$AUTOENV_FILE_LEAVE
} }
# Now keep on going on errors again.
options[errexit]=$_save_errexit
unset _save_errexit