You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
builtins.path and builtins.filterSource use a filter function which return boolean value.
If it returns true on a directory, the directory will be visited AND included into output
If it returns false on a directory, the directory will be NOT visited AND NOT included.
So a single bool is responsible for two actions.
There is no way to visit directory but exclude it from output.
Either builtins.filterSource (path: type: lib.hasSuffix ".java" path) ~/project
which do not visit directories
Or builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".java" path) ~/project
which includes all directory tree into produced output
There is nothing which work like find ~/project -type f -name '*.java'
The text was updated successfully, but these errors were encountered:
builtins.path
andbuiltins.filterSource
use a filter function which return boolean value.If it returns
true
on a directory, the directory will be visited AND included into outputIf it returns
false
on a directory, the directory will be NOT visited AND NOT included.So a single bool is responsible for two actions.
There is no way to visit directory but exclude it from output.
Either
builtins.filterSource (path: type: lib.hasSuffix ".java" path) ~/project
which do not visit directories
Or
builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".java" path) ~/project
which includes all directory tree into produced output
There is nothing which work like
find ~/project -type f -name '*.java'
The text was updated successfully, but these errors were encountered: