1
0
Fork 0

Extend getSrc to take an outFunc which operates on the filtered sources

master
Michael Raitza 2021-02-19 09:18:10 +01:00
parent 5e3b992c6f
commit 224ff92966
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ let
# scripts. # scripts.
funcPkgs = { funcPkgs = {
__functor = self: arg: resolve arg; __functor = self: arg: resolve arg;
src = getSrc root rcwd filter; src = getSrc root rcwd filter id;
inherit pkgs cwd rcwd d1 d2; inherit pkgs cwd rcwd d1 d2;
}; };

View File

@ -86,7 +86,7 @@ let
# #
# Returns a filter that accepts zero to n paths relative to cwd. Captures the # Returns a filter that accepts zero to n paths relative to cwd. Captures the
# whole source tree when called with zero arguments. # whole source tree when called with zero arguments.
getSrc = root: rcwd: rejected: getSrc = root: rcwd: rejected: outFunc:
captureFunc (resolveSrc root rcwd) (srcs: let captureFunc (resolveSrc root rcwd) (srcs: let
rejector = path: (all (x: path != x) rejected); rejector = path: (all (x: path != x) rejected);
@ -109,7 +109,7 @@ let
(rejector path) && (rejector path) &&
((srcFilter path) || ((srcFilter path) ||
(srcDirFilter path))); (srcDirFilter path)));
in (builtins.filterSource filter root)); in outFunc (builtins.filterSource filter root));
self = { self = {
inherit doFileSuffix whichdo d1 d2 getSrc; inherit doFileSuffix whichdo d1 d2 getSrc;