Extend getSrc to take an outFunc which operates on the filtered sources
parent
5e3b992c6f
commit
224ff92966
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
4
lib.nix
4
lib.nix
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue