generator: Always update docs.md for non-sys crates

This commit is contained in:
Marijn Suijten 2021-04-11 15:44:50 +02:00
parent a775f58753
commit 7bd5212484

View file

@ -87,11 +87,30 @@ def regen_crates(path, conf):
"-o", "-o",
path.parent, path.parent,
] + [d for path in conf.gir_files_paths for d in ("-d", path)] ] + [d for path in conf.gir_files_paths for d in ("-d", path)]
error = False
if path.parent.name.endswith("sys"): if path.parent.name.endswith("sys"):
args.extend(["-m", "sys"]) args.extend(["-m", "sys"])
error = False else:
# Update docs/**/docs.md for non-sys crates
# doc-target-path is relative to `-c`
path_depth = len(path.parent.parts)
doc_path = (
Path(*[".."] * path_depth, "docs")
.joinpath(path.parent)
.joinpath("docs.md")
)
print("==> Docs into {}".format(doc_path))
doc_args = args + [
"-m",
"doc",
"--doc-target-path",
doc_path,
]
error |= not run_command(doc_args)
try: try:
error = not run_command(args) error |= not run_command(args)
except Exception as err: except Exception as err:
print("The following error occurred: {}".format(err)) print("The following error occurred: {}".format(err))
error = True error = True