From 8d35fa0e2f32dab6894ca06bfc333af94be97ec7 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 14 Dec 2016 22:49:08 +0600 Subject: add dotenv plugin (#4373) --- plugins/dotenv/dotenv.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/dotenv/dotenv.plugin.zsh (limited to 'plugins/dotenv/dotenv.plugin.zsh') 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 -- cgit v1.2.3-70-g09d2