diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-01-19 19:27:53 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-01-19 19:27:53 +0100 |
commit | a7efd96a60157965370e1dbc4c7fce66b7a64225 (patch) | |
tree | 8bfbd10aca2d7dee0e87a7ef83feb272c7b26877 | |
parent | 0b08b70b0cc7ff286ea942f0e20a41f10bef0ee8 (diff) | |
download | zsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.tar.gz zsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.tar.bz2 zsh-a7efd96a60157965370e1dbc4c7fce66b7a64225.zip |
fix(dotenv): match for exact directory path in allowed/disallowed files
-rw-r--r-- | plugins/dotenv/dotenv.plugin.zsh | 4 |
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 |