Files
Bubberstation/tools/ci/template_dm_generator.py
SkyratBot d89c12eab5 [MIRROR] Completely replace Travis and AppVeyor with GitHub Actions (#1519)
* Completely replace Travis and AppVeyor with GitHub Actions

* Delete .travis.yml

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2020-11-01 16:41:43 +00:00

30 lines
695 B
Python

#!/usr/bin/env python
import os
import sys
folders = ["_maps/RandomRuins", "_maps/RandomZLevels", "_maps/shuttles",
"_maps/templates"]
generated = "_maps/templates.dm"
template_filenames = []
def find_dm(path):
L = []
for dirpath, dirnames, filenames in os.walk(path):
for name in filenames:
if name.endswith(".dmm"):
s = os.path.join(dirpath, name)
s = s.replace("_maps/","")
L.append(s)
return L
for folder in folders:
template_filenames.extend(find_dm(folder))
with open(generated, 'w') as f:
for template in template_filenames:
f.write('''#include "{}"\n'''.format(template))