diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-07-21 20:43:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-21 20:43:56 +0200 |
commit | ce9022d0df74d6c33db3686622be2050d873ab0b (patch) | |
tree | 4664643e55fe80a4065b184f2bb87613f0000a50 /scripts/build/glob_recursive.py | |
parent | 40e412da4a11de97dda041287e306ca285c50ccf (diff) | |
parent | 72675c62265f141e8aef8b925b753aa31a354645 (diff) |
Merge pull request #143 from Spartan322/seperate/build-functions
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 |