forked from extern/ohmyzsh
fix(dotenv): match for exact directory path in allowed/disallowed files
This commit is contained in:
parent
0b08b70b0c
commit
a7efd96a60
@ -23,12 +23,12 @@ source_env() {
|
|||||||
touch "$ZSH_DOTENV_DISALLOWED_LIST"
|
touch "$ZSH_DOTENV_DISALLOWED_LIST"
|
||||||
|
|
||||||
# early return if disallowed
|
# 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
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if current directory's .env file is allowed or ask for confirmation
|
# 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
|
# get cursor column and print new line before prompt if not at line beginning
|
||||||
local column
|
local column
|
||||||
echo -ne "\e[6n" > /dev/tty
|
echo -ne "\e[6n" > /dev/tty
|
||||||
|
Loading…
Reference in New Issue
Block a user