mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-09 16:09:15 +00:00
Travis now checks templates
This commit is contained in:
@@ -16,6 +16,7 @@ env:
|
||||
- DM_MAPFILE="dreamstation"
|
||||
- DM_MAPFILE="birdstation"
|
||||
- DM_MAPFILE="efficiencystation"
|
||||
- DM_MAPFILE="templates"
|
||||
|
||||
|
||||
cache:
|
||||
@@ -43,4 +44,4 @@ before_script:
|
||||
script:
|
||||
- tools/travis/check_filedirs.sh tgstation.dme
|
||||
- tools/travis/build_tools.sh
|
||||
- tools/travis/build_byond.sh
|
||||
- tools/travis/build_byond.sh
|
||||
|
||||
3
_maps/.gitignore
vendored
3
_maps/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
backup/
|
||||
backup/
|
||||
templates.dm
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$BUILD_TOOLS" = true ]; then
|
||||
cd tgui && source ~/.nvm/nvm.sh && npm install && cd ..
|
||||
if [ "$BUILD_TOOLS" = true ]; then
|
||||
cd tgui && source ~/.nvm/nvm.sh && npm install && cd ..
|
||||
fi;
|
||||
|
||||
if [ "$DM_MAPFILE" = "templates" ]; then
|
||||
python tools/travis/template_dm_generator.py
|
||||
fi;
|
||||
|
||||
30
tools/travis/template_dm_generator.py
Executable file
30
tools/travis/template_dm_generator.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import os.path
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user