summaryrefslogtreecommitdiff
path: root/plugins/dotenv/dotenv.plugin.zsh
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2018-08-08 00:05:34 +0200
committerMarc Cornellà <marc.cornella@live.com>2018-08-08 00:05:34 +0200
commitc781d708da064b42af19e20113d042b65e886d94 (patch)
tree8aa265ba85a205dbb9e2a975d36fa3554d6098c6 /plugins/dotenv/dotenv.plugin.zsh
parent9ecde7f73211607353954b6fd76fef56d7e663b3 (diff)
downloadzsh-c781d708da064b42af19e20113d042b65e886d94.tar.gz
zsh-c781d708da064b42af19e20113d042b65e886d94.tar.bz2
zsh-c781d708da064b42af19e20113d042b65e886d94.zip
dotenv: test and warn of incorrect.env syntax
Fixes #6337
Diffstat (limited to 'plugins/dotenv/dotenv.plugin.zsh')
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index a0c2d0051..b701b5596 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -1,5 +1,8 @@
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