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
# Entry is in stack.
f=$env_file
else
+ local env_file_abs=${env_file:A}
for i in $_autoenv_stack_entered; do
- if [[ ${i:A} == ${env_file:A} ]]; then
+ if [[ ${i:A} == ${env_file_abs} ]]; then
# Entry is in stack (compared with resolved symlinks).
f=$i
break
if [[ $abs_parent_dir == $look_until ]]; then
break
fi
- last=$parent_dir
+ last=$abs_parent_dir
parent_dir="${parent_dir}/.."
done
}
autoenv-edit() {
+ emulate -L zsh
local env_file
local -a files
local -A check
}
_autoenv_chpwd_handler() {
+ emulate -L zsh
_autoenv_debug "Calling chpwd handler: PWD=$PWD"
if (( $AUTOENV_DISABLED )); then