提交 481910f1 编写于 作者: M Mars Liu

add export missed

上级 a2f1bb33
{ {
"node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d", "node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d",
"keywords": ["数据库扩展", "数据库插件", "extension"], "keywords": [
"数据库扩展",
"数据库插件",
"extension"
],
"children": [], "children": [],
"export": [] "export": [
"language.json",
"extension.json"
]
} }
\ No newline at end of file
{ {
"node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc", "node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc",
"keywords": ["group by", "分组"], "keywords": [
"group by",
"分组"
],
"children": [], "children": [],
"export": [] "export": [
"salary.json"
]
} }
\ No newline at end of file
{ {
"node_id": "pg-458d5d590ea64188847b45d8e6343f83", "node_id": "pg-458d5d590ea64188847b45d8e6343f83",
"keywords": ["join", "连接查询"], "keywords": [
"join",
"连接查询"
],
"children": [], "children": [],
"export": [] "export": [
"customer_order.json"
]
} }
\ No newline at end of file
{ {
"node_id": "pg-6beb084543204f4f9d87930c0a6c5707", "node_id": "pg-6beb084543204f4f9d87930c0a6c5707",
"keywords": ["common table expression", "cte", "recursive"], "keywords": [
"common table expression",
"cte",
"recursive"
],
"children": [], "children": [],
"export": [] "export": [
"to_root.json"
]
} }
\ No newline at end of file
{ {
"node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01", "node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01",
"keywords": ["外部数据连接", "fdw"], "keywords": [
"外部数据连接",
"fdw"
],
"children": [], "children": [],
"export": [] "export": [
"fdw.json"
]
} }
\ No newline at end of file
...@@ -306,13 +306,23 @@ class TreeWalker: ...@@ -306,13 +306,23 @@ class TreeWalker:
def ensure_exercises(self, section_path): def ensure_exercises(self, section_path):
config = self.ensure_section_config(section_path) config = self.ensure_section_config(section_path)
flag = False
for e in os.listdir(section_path): for e in os.listdir(section_path):
base, ext = os.path.splitext(e) base, ext = os.path.splitext(e)
_, source = os.path.split(e) _, source = os.path.split(e)
if ext != ".md": if ext != ".md":
continue 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) 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", []): for e in config.get("export", []):
full_name = os.path.join(section_path, e) 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.
先完成此消息的编辑!
想要评论请 注册