summaryrefslogtreecommitdiff
path: root/plugins/dotenv
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-01-19 19:27:53 +0100
committerMarc Cornellà <hello@mcornella.com>2022-01-19 19:27:53 +0100
commita7efd96a60157965370e1dbc4c7fce66b7a64225 (patch)
tree8bfbd10aca2d7dee0e87a7ef83feb272c7b26877 /plugins/dotenv
parent0b08b70b0cc7ff286ea942f0e20a41f10bef0ee8 (diff)
downloadzsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.tar.gz
zsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.tar.bz2
zsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.zip
fix(dotenv): match for exact directory path in allowed/disallowed files
Diffstat (limited to 'plugins/dotenv')
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index 40ec5c46f..394455ae1 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -23,12 +23,12 @@ source_env() {
touch "$ZSH_DOTENV_DISALLOWED_LIST"
# early return if disallowed
- if command grep -q "$dirpath" "$ZSH_DOTENV_DISALLOWED_LIST" &>/dev/null; then
+ if command grep -Fx -q "$dirpath" "$ZSH_DOTENV_DISALLOWED_LIST" &>/dev/null; then
return
fi
# check if current directory's .env file is allowed or ask for confirmation
- if ! command grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then
+ if ! command grep -Fx -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then
# get cursor column and print new line before prompt if not at line beginning
local column
echo -ne "\e[6n" > /dev/tty