Automatically source .zenv files when in a directory/project tree.
Just load the plugin as you normally would using youre prefered zsh plugin manager.
Zgen:
# In $HOME/.zshrc
source "${HOME}/.zgen/zgen.zsh"
if ! zgen saved; then
zgen load noh4ck/zenv
zgen save
fi
# On the commandline
$ zplug "noh4ck/zenv", as:plugin, use:"*.sh"
Place a .zenv file in youre project root that you want automatically sourced/evaluated by zsh, thats it.
zenv provides an interface for upping and dowing the environment.
Runs when you enter the project/directory root
function zenv_up {
alias zenvtest="echo 'it works!'"
}
Runs when you exit the project/directory root
function zenv_down {
unalias zenvtest
}
You can use the ZENV_ROOT environment variable in your .zenv file to get root path of the zenv.
echo $ZENV_ROOT
# /path/to/your/zenv