浏览代码

fix(dotenv): match for exact directory path in allowed/disallowed files

Marc Cornellà 2 年之前
父节点
当前提交
a7efd96a60
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/dotenv/dotenv.plugin.zsh

+ 2 - 2
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