mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 10:18:26 +00:00
* Use sys.executable instead of python3 in docs build script * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
21 lines
586 B
Python
Executable file
21 lines
586 B
Python
Executable file
#!/usr/bin/env python3
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
here = Path(__file__).parent
|
|
|
|
for script in sorted((here / "scripts").glob("*.py")):
|
|
print(f"Generating output for {script.name}...")
|
|
out = subprocess.check_output(
|
|
[sys.executable, script.absolute()], cwd=here, text=True
|
|
)
|
|
if out:
|
|
(here / "src" / "generated" / f"{script.stem}.html").write_text(
|
|
out, encoding="utf8"
|
|
)
|
|
|
|
if (here / "public").exists():
|
|
shutil.rmtree(here / "public")
|
|
subprocess.run(["hugo"], cwd=here / "src", check=True)
|