Skip to content

Commit

Permalink
Automatically filter out empty directories in cleanCargoSource
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvp committed Oct 23, 2024
1 parent fa8b744 commit b24a7fd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/cleanCargoSource.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
, lib
}:

src: lib.cleanSourceWith {
# Apply the default source cleaning from nixpkgs
src = lib.cleanSource src;
src: lib.fileset.toSource {
root = src;

# Then add our own filter on top
filter = filterCargoSources;
# Filter out empty directories by converting back and forth from a file set
fileset = lib.fileset.fromSource (lib.cleanSourceWith {
# Apply the default source cleaning from nixpkgs
src = lib.cleanSource src;

name = internalCrateNameForCleanSource src;
# Then add our own filter on top
filter = filterCargoSources;

name = internalCrateNameForCleanSource src;
});
}

0 comments on commit b24a7fd

Please sign in to comment.