Check if "$nixfile" is a file before watching

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
Bryan Bennett 2022-12-07 08:04:17 -05:00 committed by GitHub
parent 0db25e4de9
commit 7af01eeb72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -337,7 +337,7 @@ use_nix() {
done done
nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" ".envrc" nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" ".envrc"
if [ -e "$nixfile" ]; then if [ -f "$nixfile" ]; then
nix_direnv_watch_file "$nixfile" nix_direnv_watch_file "$nixfile"
fi fi