diff options
| author | Christian Cleberg <[email protected]> | 2026-03-23 10:48:47 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-23 10:48:47 -0500 |
| commit | c5ddea05b5421a0abd549406f300dc5e3968e3c5 (patch) | |
| tree | 40177672ec2fd37fba7a5a001a7cb6444156d581 /build.py | |
| parent | afc13ea6b9b3281d156c93da33e4ea76be9ba60c (diff) | |
| download | cleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.tar.gz cleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.tar.bz2 cleberg.net-c5ddea05b5421a0abd549406f300dc5e3968e3c5.zip | |
publish Domain Dig link
Diffstat (limited to 'build.py')
| -rw-r--r-- | build.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -34,6 +34,16 @@ from datetime import datetime from pathlib import Path +def run_ruff(): + print("Running ruff...") + for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]: + result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + if result.returncode != 0: + print(f"ruff error ({' '.join(cmd)}):") + print(result.stderr, file=sys.stderr) + sys.exit(1) + + def update_index_html(html_snippet, template_path="./.build/index.html"): """ Read the index.html file at `template_path`, replace everything between @@ -558,6 +568,7 @@ def start_dev_server(build_dir): def main(): + run_ruff() html_snippet = get_recent_posts_html("./content/blog", num_posts=3) build_dir = Path(".build") |
