mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-18 19:01:47 +03:00
26 lines
575 B
Python
26 lines
575 B
Python
import SCons
|
|
|
|
|
|
def GlobRecursive(env, pattern, node=".", exclude=None):
|
|
results = []
|
|
if isinstance(node, str):
|
|
node = env.Dir(node)
|
|
for f in node.glob("*", source=True, exclude=exclude):
|
|
if isinstance(f, SCons.Node.FS.Dir):
|
|
results += env.GlobRecursive(pattern, f, exclude)
|
|
results += node.glob(
|
|
pattern,
|
|
source=True,
|
|
exclude=exclude,
|
|
)
|
|
# print(f"Glob for {pattern} from {node}: {results}")
|
|
return results
|
|
|
|
|
|
def generate(env):
|
|
env.AddMethod(GlobRecursive)
|
|
|
|
|
|
def exists(env):
|
|
return True
|