summaryrefslogtreecommitdiff
path: root/plugins/dotenv/dotenv.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-02-12 18:07:38 -0700
committerTuowen Zhao <ztuowen@gmail.com>2020-02-12 18:07:38 -0700
commit93a2003db7738e2255a4589ef2073df1be34fe02 (patch)
treec2f6b378ffae6d4f433acf2a1931d1cc1f3f0574 /plugins/dotenv/dotenv.plugin.zsh
parent891ef3d57b6d5e38e10c0894c3d956416adc95e2 (diff)
parenta6df94d2c677c6d28c5ee339975b7a56a2f67e21 (diff)
downloadzsh-93a2003db7738e2255a4589ef2073df1be34fe02.tar.gz
zsh-93a2003db7738e2255a4589ef2073df1be34fe02.tar.bz2
zsh-93a2003db7738e2255a4589ef2073df1be34fe02.zip
Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh
Diffstat (limited to 'plugins/dotenv/dotenv.plugin.zsh')
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index 89763d0ee..d4a6db8f8 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -1,5 +1,12 @@
source_env() {
if [[ -f $ZSH_DOTENV_FILE ]]; then
+ # confirm before sourcing .env file
+ local confirmation
+ echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
+ if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
+ return
+ fi
+
# test .env syntax
zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2