MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / on_files

Function on_files

scripts/docs/build_cli_reference.py:18–32  ·  view source on GitHub ↗
(files: Files, config: Config)

Source from the content-addressed store, hash-verified

16
17
18def on_files(files: Files, config: Config):
19 if not is_cli_doc_available():
20 if os.environ.get("GITHUB_ACTIONS", "0") == "1":
21 raise Exception("cli_doc not available in CI")
22 print("Skipping generation of CLI reference, because `cli_doc` is not installed")
23 return
24
25 hq_path = os.environ.get("HQ_PATH", "target/debug/hq")
26 print("Generating CLI reference")
27
28 with tempfile.NamedTemporaryFile() as tmp_file:
29 subprocess.run(["cli_doc", hq_path, "--output-filename", tmp_file.name], check=True)
30 with open(tmp_file.name) as src:
31 content = src.read()
32 files.append(File.generated(config, "cli-reference/index.html", content=content))

Callers

nothing calls this directly

Calls 4

is_cli_doc_availableFunction · 0.85
appendMethod · 0.80
getMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected