[object Object]

← back to Wallco Ai

fix(room-mockups): resolve ROOT from __file__ not Path.home() so prod writes to served data/rooms (not unserved /root/Projects)

be08cbc1a194e322f310441ffa6323289bea39a4 · 2026-05-30 10:18:51 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit be08cbc1a194e322f310441ffa6323289bea39a4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat May 30 10:18:51 2026 -0700

    fix(room-mockups): resolve ROOT from __file__ not Path.home() so prod writes to served data/rooms (not unserved /root/Projects)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/generate_room_mockups.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/generate_room_mockups.py b/scripts/generate_room_mockups.py
index 5bf5b94..82e1cf3 100644
--- a/scripts/generate_room_mockups.py
+++ b/scripts/generate_room_mockups.py
@@ -11,7 +11,11 @@ from pathlib import Path
 import urllib.request, urllib.error
 
 ROOM_API = 'http://45.61.58.125:3075/api/generate-room'
-ROOT = Path.home() / 'Projects' / 'wallco-ai'
+# ROOT must resolve to THIS checkout (scripts/ -> project root), NOT Path.home()/Projects/wallco-ai.
+# On prod the served tree is /root/public-projects/wallco-ai; the old Path.home() form wrote PNGs to
+# the UNSERVED /root/Projects/wallco-ai/data/rooms -> 404 on the customer PDP (memory:
+# feedback_wallco_room_mockups_jsonflag_vs_file_and_pathdrift). Same dir on Mac2, correct dir on prod.
+ROOT = Path(__file__).resolve().parent.parent
 OUT_DIR = ROOT / 'data' / 'rooms'
 OUT_DIR.mkdir(parents=True, exist_ok=True)
 

← 44fb906 Add living-room mockups for 55 cactus designs (Mac2 PIL+SQL,  ·  back to Wallco Ai  ·  elements/img: fall back to source tile by-id when baked deri dfe2bce →