mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
Manual: Handle XML files in subdirectories
This commit is contained in:
parent
8cfd9b1acd
commit
b1ce3cc172
2 changed files with 18 additions and 14 deletions
|
@ -21,12 +21,12 @@ rec {
|
|||
|
||||
|
||||
# Get all files ending with the specified suffices from the given
|
||||
# directory. E.g. `sourceFilesBySuffices ./dir [".xml" ".c"]'.
|
||||
# directory or its descendants. E.g. `sourceFilesBySuffices ./dir
|
||||
# [".xml" ".c"]'.
|
||||
sourceFilesBySuffices = path: exts:
|
||||
let filter = name: type:
|
||||
let base = baseNameOf (toString name);
|
||||
in type != "directory" && lib.any (ext: lib.hasSuffix ext base) exts;
|
||||
in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
|
||||
in builtins.filterSource filter path;
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue