lib.filesystem.listFilesRecursive: only flatten once
This commit is contained in:
@@ -239,16 +239,15 @@ in
|
|||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
listFilesRecursive =
|
listFilesRecursive =
|
||||||
dir:
|
let
|
||||||
lib.flatten (
|
# We only flatten at the very end, as flatten is recursive.
|
||||||
lib.mapAttrsToList (
|
internalFunc =
|
||||||
name: type:
|
dir:
|
||||||
if type == "directory" then
|
(lib.mapAttrsToList (
|
||||||
lib.filesystem.listFilesRecursive (dir + "/${name}")
|
name: type: if type == "directory" then internalFunc (dir + "/${name}") else dir + "/${name}"
|
||||||
else
|
) (builtins.readDir dir));
|
||||||
dir + "/${name}"
|
in
|
||||||
) (builtins.readDir dir)
|
dir: lib.flatten (internalFunc dir);
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Transform a directory tree containing package files suitable for
|
Transform a directory tree containing package files suitable for
|
||||||
|
|||||||
Reference in New Issue
Block a user