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