summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-02-18 19:41:21 +0100
committerMarc Cornellà <hello@mcornella.com>2022-02-18 19:41:21 +0100
commit3427da4057dbe302933a7b5b19b4e23bfb9d0969 (patch)
tree92943d5722043fe022a86ec204313987d58d6db3
parentef3f7c43a91eb2c90098843b0ee9193bb52cdc96 (diff)
downloadzsh-3427da4057dbe302933a7b5b19b4e23bfb9d0969.tar.gz
zsh-3427da4057dbe302933a7b5b19b4e23bfb9d0969.tar.bz2
zsh-3427da4057dbe302933a7b5b19b4e23bfb9d0969.zip
fix(dotenv): actually exit when .env syntax is broken
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index 394455ae1..46cd4b10a 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -52,7 +52,10 @@ source_env() {
fi
# test .env syntax
- zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
+ zsh -fn $ZSH_DOTENV_FILE || {
+ echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
+ return 1
+ }
setopt localoptions allexport
source $ZSH_DOTENV_FILE