mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
fix crash if DIRENV_WATCHES is not set
This shouldn't happen in our current usage but better safe than sorry.
This commit is contained in:
parent
a20b32d9cd
commit
946b84daed
1 changed files with 3 additions and 0 deletions
3
direnvrc
3
direnvrc
|
|
@ -204,6 +204,9 @@ nix_direnv_watch_file() {
|
|||
|
||||
_nix_direnv_watches() {
|
||||
local -n _watches=$1
|
||||
if [[ -z "${DIRENV_WATCHES-}" ]]; then
|
||||
return
|
||||
fi
|
||||
while IFS= read -r line; do
|
||||
local regex='"path": "(.+)"$'
|
||||
if [[ "$line" =~ $regex ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue