diff options
Diffstat (limited to 'plugins/dotenv/dotenv.plugin.zsh')
-rw-r--r-- | plugins/dotenv/dotenv.plugin.zsh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index fa47c4c68..b701b5596 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,7 +1,8 @@ -#!/bin/zsh - source_env() { if [[ -f .env ]]; then + # test .env syntax + zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2 + if [[ -o a ]]; then source .env else @@ -14,3 +15,5 @@ source_env() { autoload -U add-zsh-hook add-zsh-hook chpwd source_env + +source_env |