diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2018-09-10 10:50:45 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2018-09-10 10:50:45 -0600 |
commit | 5ece6ef2f07c58672a9c965dbbbb62a42386fb2d (patch) | |
tree | 285e6382f9e900779bce60da02f1f0d97e467e26 /plugins/dotenv | |
parent | 852e7fe005267f74f3c04a4ddbb310522eee8014 (diff) | |
parent | fe5fe81c8cfa66981c51d149a35fe545f2ef5016 (diff) | |
download | zsh-5ece6ef2f07c58672a9c965dbbbb62a42386fb2d.tar.gz zsh-5ece6ef2f07c58672a9c965dbbbb62a42386fb2d.tar.bz2 zsh-5ece6ef2f07c58672a9c965dbbbb62a42386fb2d.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/dotenv')
-rw-r--r-- | plugins/dotenv/README.md | 2 | ||||
-rw-r--r-- | plugins/dotenv/dotenv.plugin.zsh | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index e0e75571f..e880e9d69 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -2,7 +2,7 @@ Automatically load your project ENV variables from `.env` file when you `cd` into project root directory. -Storing configuration in the environment is one of the tenets of a [twelve-factor app](http://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables. +Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables. ## Installation diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index fa47c4c68..b701b5596 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,7 +1,8 @@ -#!/bin/zsh - 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 @@ -14,3 +15,5 @@ source_env() { autoload -U add-zsh-hook add-zsh-hook chpwd source_env + +source_env |