From 3427da4057dbe302933a7b5b19b4e23bfb9d0969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 18 Feb 2022 19:41:21 +0100 Subject: [PATCH] fix(dotenv): actually exit when .env syntax is broken --- plugins/dotenv/dotenv.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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