diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-07-25 02:24:01 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-07-26 23:54:58 +0200 |
commit | be1d0545c2f7a85a63d05b4bdc1020ee284e72cb (patch) | |
tree | 09cb0fa0a1dbe83d4833bcd62dc8832161e4329b /scripts/build/glob_recursive.py | |
parent | 65443efcc2f4c7d687b2bd9c631f6bb426688bbf (diff) |
Initial structural commit
Diffstat (limited to 'scripts/build/glob_recursive.py')
-rw-r--r-- | scripts/build/glob_recursive.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/glob_recursive.py b/scripts/build/glob_recursive.py new file mode 100644 index 0000000..db6eb80 --- /dev/null +++ b/scripts/build/glob_recursive.py @@ -0,0 +1,15 @@ +def GlobRecursive(pattern, nodes=['.']): + import SCons + import glob + fs = SCons.Node.FS.get_default_fs() + Glob = fs.Glob + + results = [] + for node in nodes: + nnodes = [] + for f in Glob(str(node) + '/*', source=True): + if type(f) is SCons.Node.FS.Dir: + nnodes.append(f) + results += GlobRecursive(pattern, nnodes) + results += Glob(str(node) + '/' + pattern, source=True) + return results |