ohmyzsh/plugins/dotenv/dotenv.plugin.zsh
Arthur 7cb5fa8aea Fix dotenv plugin accepted file format and clarify README (#6093)
* Fix dotenv plugin accepted file format

* clarify README and add disclaimer section
2018-07-10 23:31:47 +02:00

17 lines
217 B
Bash

#!/bin/zsh
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