summaryrefslogtreecommitdiff
path: root/plugins/dotenv/dotenv.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-12-25 08:01:49 -0700
committerTuowen Zhao <ztuowen@gmail.com>2016-12-25 08:01:49 -0700
commit0ebfa3a504a0a4de40154432918c5f8acb33bdae (patch)
tree3f75aab75e1e031ebb74ea77501a0b2303203049 /plugins/dotenv/dotenv.plugin.zsh
parent8f5c00c3374af83a45f541ac0c7d81f6b6219c5d (diff)
parent97c03841691021f916c46b2fd2d089d7970400aa (diff)
downloadzsh-0ebfa3a504a0a4de40154432918c5f8acb33bdae.tar.gz
zsh-0ebfa3a504a0a4de40154432918c5f8acb33bdae.tar.bz2
zsh-0ebfa3a504a0a4de40154432918c5f8acb33bdae.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/dotenv/dotenv.plugin.zsh')
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
new file mode 100644
index 000000000..9dd784229
--- /dev/null
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -0,0 +1,10 @@
+#!/bin/zsh
+
+source_env() {
+ if [[ -f .env ]]; then
+ source .env
+ fi
+}
+
+autoload -U add-zsh-hook
+add-zsh-hook chpwd source_env