Closed ilkecan closed 2 years ago
Given the following directory
$ tree . ├── data │ ├── a │ ├── b │ └── c ├── flake.lock └── flake.nix
The following nix-filter call was producing an empty directory:
nix-filter
let inherit (nix-filter) inDirectory; in nix-filter { root = ./.; name = "test"; include = [ (inDirectory "data") ]; exclude = [ "data/a" ]; }
Because of this line https://github.com/numtide/nix-filter/blob/3c9e33ed627e009428197b07216613206f06ed80/default.nix#L35
In essence, it is changed to
path_ == path || args.matchParents && type == "directory" && _hasPrefix "${path}/" path_;
where args.matchParents is true for include and false for exclude.
args.matchParents
true
include
false
exclude
I removed some stylistic changes so the diff should be smaller now.
nice, thanks for tackling this issue
Given the following directory
The following
nix-filter
call was producing an empty directory:Because of this line https://github.com/numtide/nix-filter/blob/3c9e33ed627e009428197b07216613206f06ed80/default.nix#L35
In essence, it is changed to
where
args.matchParents
istrue
forinclude
andfalse
forexclude
.