Don't track $nixfile if it is empty

This commit is contained in:
Bryan Bennett 2022-12-06 15:05:52 -05:00
parent 22b5729f26
commit 0db25e4de9
No known key found for this signature in database
GPG key ID: EF90E3E98B8F5C0B
2 changed files with 9 additions and 3 deletions

View file

@ -336,9 +336,10 @@ use_nix() {
esac
done
# nixfile may be empty,
# but nix_direnv_watch_file checks for existence before adding to watches
nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" .envrc "$nixfile"
nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" ".envrc"
if [ -e "$nixfile" ]; then
nix_direnv_watch_file "$nixfile"
fi
local need_update=0
local file=