]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
Comments / doc
authorDaniel Hahler <git@thequod.de>
Sun, 16 Nov 2014 10:28:43 +0000 (11:28 +0100)
committerDaniel Hahler <git@thequod.de>
Mon, 24 Nov 2014 19:13:18 +0000 (20:13 +0100)
autoenv.zsh

index a1acc3695060864874a79cfc48fd9fe1df142a0b..b7f5976c0e243f0b8182ddc5e7ba3694cf1b9d89 100644 (file)
@@ -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