Skip to content

Commit 7415c6c

Browse files
committed
Updated build.py for Travis Check
1 parent 1466bff commit 7415c6c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

build.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import time
2323
import yaml
2424
import requests
25+
import tempfile
2526

2627
from aura import cli
2728

@@ -151,9 +152,25 @@ def find_build_config_file():
151152
"""
152153
Finds the build config file to use, as it might be _topic_map.yml or _build_cfg.yml
153154
"""
154-
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
155+
156+
# updated 23rd Nov to support files in _topic_maps folder
157+
158+
# load everything from the _topic_maps folder
159+
file_list = os.listdir(os.path.join(CLONE_DIR, "_topic_maps"))
160+
161+
# create a temp file combining all values from that folder
162+
# don't delete it immediately, and give it a suffix of swp which makes it ignored by git
163+
with tempfile.NamedTemporaryFile(dir=CLONE_DIR, delete=False, suffix=".swp") as tmp:
164+
for f in file_list:
165+
with open(os.path.join(CLONE_DIR, "_topic_maps", f), "rb") as infile:
166+
tmp.write(infile.read())
167+
168+
config = os.path.abspath(tmp.name)
169+
log.info(config)
170+
171+
# backup look for a single _topic_map in the cloned directory
155172
if not os.path.isfile(config):
156-
config = os.path.abspath(os.path.join(CLONE_DIR, "_build_cfg.yml"))
173+
config = os.path.abspath(os.path.join(CLONE_DIR, "_topic_map.yml"))
157174

158175
return config
159176

0 commit comments

Comments
 (0)