3427da4057dbe302933a7b5b19b4e23bfb9d0969
- Author
- Marc Cornellà <hello@mcornella.com>
- Committer
- Marc Cornellà <hello@mcornella.com>
- Date
Message
fix(dotenv): actually exit when .env syntax is broken
Diff
1diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
2index 394455ae1c44a2db98fe42871c6f4e7e09ab3984..46cd4b10ab400f5697c3a101aa52d686812ecab5 100644
3--- a/plugins/dotenv/dotenv.plugin.zsh
4+++ b/plugins/dotenv/dotenv.plugin.zsh
5@@ -52,7 +52,10 @@ source_env() {
6 fi
7
8 # test .env syntax
9- zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
10+ zsh -fn $ZSH_DOTENV_FILE || {
11+ echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
12+ return 1
13+ }
14
15 setopt localoptions allexport
16 source $ZSH_DOTENV_FILE