numtide / nix-filter

a small self-contained source filtering lib
MIT License
200 stars 17 forks source link

Adding support for recursive file filtering without including empty directories. #32

Open ursi opened 2 years ago

ursi commented 2 years ago

I came up with an approach to fix the empty directory problem. I wanted to make you aware of it in case you'd be able to use it to improve the UX. https://github.com/NixOS/nixpkgs/pull/188301.

zimbatm commented 2 years ago

thanks. It looks like a similar idea as https://github.com/numtide/nix-filter/issues/9#issuecomment-1194442257 where the algorithm first traverses the filesystem using builtins.readDir, and then applies the filtered result to builtins.path. It's a good idea.