]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - tests/setup.zsh
Optimize _autoenv_authorized_env_file
[zsh-autoenv.git] / tests / setup.zsh
index 9b15bf1db0ca3ab22b56096e39e7e21d275cbfa2..0bbdbafa74ad8d9b7572b6b6bbae141d1512cef0 100644 (file)
@@ -29,9 +29,10 @@ fi
 # Add file ($1), version ($2), and optional hash ($3) to authentication file.
 test_autoenv_add_to_env() {
   [[ -d ${AUTOENV_AUTH_FILE:h} ]] || mkdir -p ${AUTOENV_AUTH_FILE:h}
+  _autoenv_deauthorize $1
   {
     local ret_pair
-    _autoenv_hash_pair $1 1 ${2:-} && echo $ret_pair
+    _autoenv_hash_pair $1 2 ${2:-} && echo $ret_pair
   } >>| $AUTOENV_AUTH_FILE
 }