(files: Files, config: Config)
| 16 | |
| 17 | |
| 18 | def 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)) |
nothing calls this directly
no test coverage detected