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
Add the 'ReadDirRecursive()' function to 'FileSystem' to facilitate easy
lookup of filesystem entries at a fixed depth from the root. In later
commits, this will be used to look up routes in the bundle server under the
'reporoot' on the filesystem.
'ReadDirRecursive()' takes three arguments:
* 'path': the root directory into which we want to recurse
* 'depth': the number of times to recurse into 'path'. A depth of 0 will
return nothing, a depth of 1 will return all entries inside 'path', a
depth of 2 will return all entries inside the subdirectories of 'path',
etc.
* 'strictDepth': a flag indicating whether to return only entries that are
*exactly 'depth' levels beneath 'path'. If 'false', 'ReadDirRecursive()'
will also include files and empty directories at depths less than 'depth'.
For example, consider the following directory tree:
.
├── another-dir/
│ └── testfile
├── myfile
├── org/
│ └── repo/
│ ├── deeper/
│ └── repofile
└── too-shallow/
'ReadDirRecursive(".", 2, true)' will return:
- ./another-dir/testfile
- ./org/repo/
Whereas 'ReadDirRecursive(".", 2, false)' will return:
- ./another-dir/testfile
- ./myfile
- ./org/repo/
- ./too-shallow/
Signed-off-by: Victoria Dye <[email protected]>
0 commit comments