| @@ -29,11 +29,10 @@ import re |
| 29 | 29 | import shutil |
| 30 | 30 | import subprocess |
| 31 | 31 | import sys |
| 32 | | from html import escape |
| 33 | | from urllib.parse import quote |
| 34 | 32 | from datetime import datetime |
| 33 | from html import escape |
| 35 | 34 | from pathlib import Path |
| 36 | | |
| 35 | from urllib.parse import quote |
| 37 | 36 | |
| 38 | 37 | SITE_TEMPLATE_VARS = { |
| 39 | 38 | "site_name": "cleberg.net", |
| @@ -45,9 +44,7 @@ SITE_TEMPLATE_VARS = { |
| 45 | 44 | def run_ruff(): |
| 46 | 45 | print("Running ruff...") |
| 47 | 46 | for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]: |
| 48 | | result = subprocess.run( |
| 49 | | cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True |
| 50 | | ) |
| 47 | result = subprocess.run(cmd, capture_output=True, text=True, check=False) |
| 51 | 48 | if result.returncode != 0: |
| 52 | 49 | print(f"ruff error ({' '.join(cmd)}):") |
| 53 | 50 | print(result.stderr, file=sys.stderr) |
| @@ -300,9 +297,9 @@ def minify_css(src_css, dest_css): |
| 300 | 297 | print(f"Minifying CSS: {src_css} → {dest_css}") |
| 301 | 298 | result = subprocess.run( |
| 302 | 299 | ["minify", "-o", str(dest_css), str(src_css)], |
| 303 | | stdout=subprocess.PIPE, |
| 304 | | stderr=subprocess.PIPE, |
| 300 | capture_output=True, |
| 305 | 301 | text=True, |
| 302 | check=False, |
| 306 | 303 | ) |
| 307 | 304 | if result.returncode != 0: |
| 308 | 305 | print("Error during CSS minification:") |
| @@ -314,9 +311,9 @@ def minify_html(src_html, dest_html): |
| 314 | 311 | print(f"Minifying HTML: {src_html} → {dest_html}") |
| 315 | 312 | result = subprocess.run( |
| 316 | 313 | ["minify", "-o", str(dest_html), str(src_html)], |
| 317 | | stdout=subprocess.PIPE, |
| 318 | | stderr=subprocess.PIPE, |
| 314 | capture_output=True, |
| 319 | 315 | text=True, |
| 316 | check=False, |
| 320 | 317 | ) |
| 321 | 318 | if result.returncode != 0: |
| 322 | 319 | print("Error during HTML minification:") |
| @@ -333,6 +330,7 @@ def run_emacs_publish(dev_mode=True): |
| 333 | 330 | stdout=subprocess.PIPE, |
| 334 | 331 | stderr=subprocess.STDOUT, |
| 335 | 332 | text=True, |
| 333 | check=False, |
| 336 | 334 | ) |
| 337 | 335 | |
| 338 | 336 | if result.returncode != 0: |
| @@ -538,9 +536,9 @@ def deploy_to_server(build_dir, server): |
| 538 | 536 | print(f"Deploying .build/ → {remote_path}") |
| 539 | 537 | result = subprocess.run( |
| 540 | 538 | ["rsync", "-r", "--delete-before", f"{build_dir}/", remote_path], |
| 541 | | stdout=subprocess.PIPE, |
| 542 | | stderr=subprocess.PIPE, |
| 539 | capture_output=True, |
| 543 | 540 | text=True, |
| 541 | check=False, |
| 544 | 542 | ) |
| 545 | 543 | if result.returncode != 0: |
| 546 | 544 | print("Error during rsync deployment:") |