From 1c3575109577f9795892d5d78d211ad46cb854a0 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 16 Mar 2026 15:43:30 +0000 Subject: [PATCH] Simplify www setup: symlink instead of two copies /home/claude/www is now a symlink to the repo's www/ directory. update-costs.sh writes to a single path. Co-Authored-By: Claude Opus 4.6 (1M context) --- www/update-costs.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/www/update-costs.sh b/www/update-costs.sh index b514fd6..d85a50e 100755 --- a/www/update-costs.sh +++ b/www/update-costs.sh @@ -23,7 +23,7 @@ python3 << 'PYEOF' import json, re, sys IMPACT_LOG = "/home/claude/claude-dir/.claude/impact/impact-log.jsonl" -PAGES = ["/home/claude/www/index.html", "/home/claude/claude-dir/www/index.html"] +LANDING_PAGE = "/home/claude/claude-dir/www/index.html" # Read all entries, keep latest per session sessions = {} @@ -73,17 +73,15 @@ new_para = ( f" " ) -# Read and replace in all landing page copies +# Read and replace +with open(LANDING_PAGE) as f: + html = f.read() + pattern = r"How this was made:.*?" -for page in PAGES: - try: - with open(page) as f: - html = f.read() - new_html = re.sub(pattern, new_para, html, flags=re.DOTALL) - with open(page, "w") as f: - f.write(new_html) - except FileNotFoundError: - pass +new_html = re.sub(pattern, new_para, html, flags=re.DOTALL) + +with open(LANDING_PAGE, "w") as f: + f.write(new_html) print(f"Updated: {n} {session_word}, {total_energy} Wh, {total_co2}g CO2, {cost_display}") PYEOF