From d9529636b0661a54ca5bc2f5e99ee327c0f50d32 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 16 Nov 2014 11:28:43 +0100 Subject: [PATCH] Comments / doc --- autoenv.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoenv.zsh b/autoenv.zsh index a1acc36..b7f5976 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -82,7 +82,11 @@ _dotenv_check_authorized_env_file() { return 0 } +# Initialize $_dotenv_sourced_varstash, but do not overwrite an existing one +# from e.g. `exec zsh` (to reload your shell config). : ${_dotenv_sourced_varstash:=0} + +# Get directory of this file (absolute, with resolved symlinks). _dotenv_this_dir=${0:A:h} _dotenv_source() { @@ -94,8 +98,9 @@ _dotenv_source() { if [[ $_dotenv_sourced_varstash == 0 ]]; then source $_dotenv_this_dir/lib/varstash export _dotenv_sourced_varstash=1 + # NOTE: Varstash uses $PWD as default for varstash_dir, we might set it to + # ${env_file:h}. fi - # varstash_dir=${env_file:h} # Change to directory of env file, source it and cd back. local new_dir=$PWD