提交 b1ad2b92 编写于 作者: M Mars Liu

fixed odd orders

上级 97562282
......@@ -306,13 +306,23 @@ class TreeWalker:
def ensure_exercises(self, section_path):
config = self.ensure_section_config(section_path)
flag = False
for e in os.listdir(section_path):
base, ext = os.path.splitext(e)
_, source = os.path.split(e)
if ext != ".md":
continue
meta_path = os.path.join(section_path, base + ".json")
mfile = base + ".json"
meta_path = os.path.join(section_path, mfile)
self.ensure_exercises_meta(meta_path, source)
export = config.get("export", [])
if mfile not in export:
export.append(mfile)
flag = True
config["export"] = export
if flag:
dump_json(os.path.join(section_path, "config.json"), config, True, True)
for e in config.get("export", []):
full_name = os.path.join(section_path, e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册