ohmyzsh/plugins/dotenv/dotenv.plugin.zsh
2018-08-07 23:54:07 +02:00

17 lines
217 B
Bash

source_env() {
if [[ -f .env ]]; then
if [[ -o a ]]; then
source .env
else
set -a
source .env
set +a
fi
fi
}
autoload -U add-zsh-hook
add-zsh-hook chpwd source_env
source_env