c781d708da064b42af19e20113d042b65e886d94
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
dotenv: test and warn of incorrect.env syntax
Fixes #6337
Diff
1diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
2index a0c2d0051944c7aba5f22e6919055b0b2924ad32..b701b5596c8ba79eb1f0001af80035899dbbf347 100644
3--- a/plugins/dotenv/dotenv.plugin.zsh
4+++ b/plugins/dotenv/dotenv.plugin.zsh
5@@ -1,5 +1,8 @@
6 source_env() {
7 if [[ -f .env ]]; then
8+ # test .env syntax
9+ zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2
10+
11 if [[ -o a ]]; then
12 source .env
13 else