]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - autoenv.zsh
README: improve .venv example
[zsh-autoenv.git] / autoenv.zsh
index e70eec165000b6a6fdfc99a0191caeaaa84ce73c..fe97d74fe72b8f0db252c457faee51b4df06c7b6 100644 (file)
@@ -59,6 +59,29 @@ autoenv_source_parent() {
   fi
 }
 
+autoenv_append_path() {
+  local i
+  for i; do
+    (( ${path[(i)$i]} <= ${#path} )) && continue
+    path+=($i)
+  done
+}
+autoenv_prepend_path() {
+  local i
+  for i; do
+    (( ${path[(i)$i]} <= ${#path} )) && continue
+    path=($i $path)
+  done
+}
+autoenv_remove_path() {
+  local i
+  local old_path=$path
+  for i; do
+    path=("${(@)path:#$i}")
+  done
+  [[ $old_path != $path ]]
+}
+
 # Internal functions. {{{
 # Internal: stack of loaded env files (i.e. entered directories). {{{
 typeset -g -a _autoenv_stack_entered
@@ -453,6 +476,7 @@ _autoenv_chpwd_handler() {
   fi
 
   if ! _autoenv_check_authorized_env_file $env_file; then
+    _autoenv_debug "Not authorized: $env_file"
     return
   fi