mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-22 07:20:59 +02:00
tests: streamline ZDOTDIR layout, AUTOENV_ENV_FILENAME via setup
Without this, a new subshell would reset the env authentication file.
This commit is contained in:
parent
d62fbffad3
commit
fd54606830
@ -1,3 +1,4 @@
|
||||
# Source base setup.
|
||||
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
|
||||
|
||||
setopt noclobber
|
||||
|
@ -10,4 +10,5 @@ zstat() {
|
||||
echo "Should not get called."
|
||||
}
|
||||
|
||||
# Source base setup.
|
||||
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
|
||||
|
@ -1,11 +1,7 @@
|
||||
test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump"
|
||||
|
||||
AUTOENV_DEBUG=0
|
||||
# Source base setup.
|
||||
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
|
||||
|
||||
antigen-like-loader-function() {
|
||||
source "$TESTDIR/../autoenv.plugin.zsh"
|
||||
}
|
||||
|
||||
export AUTOENV_ENV_FILENAME="$PWD/.env_auth"
|
||||
|
||||
echo -n > $AUTOENV_ENV_FILENAME
|
||||
TEST_SOURCE_AUTOENV=antigen-like-loader-function
|
||||
|
@ -1,7 +1,3 @@
|
||||
test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump"
|
||||
# Base setup/config.
|
||||
|
||||
AUTOENV_DEBUG=0
|
||||
|
||||
export AUTOENV_ENV_FILENAME="$PWD/.env_auth"
|
||||
|
||||
echo -n > $AUTOENV_ENV_FILENAME
|
||||
TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh)
|
||||
|
@ -9,6 +9,8 @@
|
||||
# Not handled in varstash yet.
|
||||
# setopt nounset
|
||||
|
||||
export AUTOENV_ENV_FILENAME="$CRAMTMP/.env_auth"
|
||||
|
||||
if [[ $AUTOENV_ENV_FILENAME[0,4] != '/tmp' ]]; then
|
||||
echo "AUTOENV_ENV_FILENAME is not in /tmp. Aborting."
|
||||
return 1
|
||||
@ -18,11 +20,7 @@ fi
|
||||
_save_errexit=${options[errexit]}
|
||||
set -e
|
||||
|
||||
if (( ${+functions[antigen-like-loader-function]} )); then
|
||||
TEST_SOURCE_AUTOENV=antigen-like-loader-function
|
||||
else
|
||||
TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh)
|
||||
fi
|
||||
# Defined in .zshenv, e.g. tests/ZDOTDIR/.zshenv.
|
||||
$TEST_SOURCE_AUTOENV
|
||||
|
||||
# Reset any authentication.
|
||||
|
Loading…
Reference in New Issue
Block a user