Browse Source

fix(dotenv): actually exit when .env syntax is broken

Marc Cornellà 2 years ago
parent
commit
3427da4057
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/dotenv/dotenv.plugin.zsh

+ 4 - 1
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