mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
Don't track $nixfile if it is empty
This commit is contained in:
parent
22b5729f26
commit
0db25e4de9
2 changed files with 9 additions and 3 deletions
7
direnvrc
7
direnvrc
|
|
@ -336,9 +336,10 @@ use_nix() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# nixfile may be empty,
|
nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" ".envrc"
|
||||||
# but nix_direnv_watch_file checks for existence before adding to watches
|
if [ -e "$nixfile" ]; then
|
||||||
nix_direnv_watch_file "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc" .envrc "$nixfile"
|
nix_direnv_watch_file "$nixfile"
|
||||||
|
fi
|
||||||
|
|
||||||
local need_update=0
|
local need_update=0
|
||||||
local file=
|
local file=
|
||||||
|
|
|
||||||
|
|
@ -33,5 +33,10 @@ def test_args(direnv_project: DirenvProject) -> None:
|
||||||
direnv_exec(direnv_project, "echo $SHOULD_BE_SET")
|
direnv_exec(direnv_project, "echo $SHOULD_BE_SET")
|
||||||
|
|
||||||
|
|
||||||
|
def test_no_files(direnv_project: DirenvProject) -> None:
|
||||||
|
direnv_project.setup_envrc("use nix -p hello")
|
||||||
|
direnv_exec(direnv_project, "hello")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue