← back to Designer Wallcoverings
Add ALLOW_LIVE-gated live push script for Boost infinite override
f917d990ae34aa23a9018264bcbada1b62aabd61 · 2026-06-24 08:07:11 -0700 · Steve
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A shopify/theme-infinite-scroll-142250278963/push-boost-override-to-LIVE.sh
Diff
commit f917d990ae34aa23a9018264bcbada1b62aabd61
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Jun 24 08:07:11 2026 -0700
Add ALLOW_LIVE-gated live push script for Boost infinite override
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
.../push-boost-override-to-LIVE.sh | 58 ++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/shopify/theme-infinite-scroll-142250278963/push-boost-override-to-LIVE.sh b/shopify/theme-infinite-scroll-142250278963/push-boost-override-to-LIVE.sh
new file mode 100644
index 00000000..30c572a3
--- /dev/null
+++ b/shopify/theme-infinite-scroll-142250278963/push-boost-override-to-LIVE.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# GATED: push the Boost infinite-scroll OVERRIDE to the LIVE (role=main) theme.
+# Requires ALLOW_LIVE=1 (Steve-gated). Backs up each asset (GET before PUT),
+# verifies (GET after PUT). Identical assets to the dev push, verified on dev
+# theme 143956443187 (desktop 24->264, mobile 24->264, no numbered pager).
+#
+# THEME_TOKEN=shpat_xxx ALLOW_LIVE=1 bash push-boost-override-to-LIVE.sh
+set -euo pipefail
+cd "$(dirname "$0")"
+STORE="designer-laboratory-sandbox.myshopify.com"; API="2024-10"
+TOK="${THEME_TOKEN:?set THEME_TOKEN}"
+
+LIVE="$(curl -sS -H "X-Shopify-Access-Token: $TOK" "https://$STORE/admin/api/$API/themes.json" \
+ | python3 -c 'import sys,json; print(next((str(t["id"]) for t in json.load(sys.stdin)["themes"] if t["role"]=="main"),""))')"
+echo "live(role=main)=$LIVE"
+if [ "${ALLOW_LIVE:-0}" != "1" ]; then
+ echo "REFUSING: writing the LIVE theme requires ALLOW_LIVE=1 (Steve-gated)."; exit 2
+fi
+[ -n "$LIVE" ] || { echo "could not resolve live theme"; exit 3; }
+
+python3 - "$STORE" "$API" "$TOK" "$LIVE" <<'PY'
+import sys,json,os,urllib.request,urllib.parse,datetime,time
+store,api,tok,tid=sys.argv[1:5]
+H={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"}
+base=f"https://{store}/admin/api/{api}/themes/{tid}/assets.json"
+def get(key):
+ u=base+"?"+urllib.parse.urlencode({"asset[key]":key})
+ return json.load(urllib.request.urlopen(urllib.request.Request(u,headers=H)))["asset"]["value"]
+def put(key,val):
+ body=json.dumps({"asset":{"key":key,"value":val}}).encode()
+ return urllib.request.urlopen(urllib.request.Request(base,data=body,method="PUT",headers=H)).status
+FILES={
+ "layout/theme.liquid.live52-base": "layout/theme.liquid",
+ "snippets/boost-infinite-override.liquid": "snippets/boost-infinite-override.liquid",
+ "assets/boost-sd-custom.js": "assets/boost-sd-custom.js",
+}
+os.makedirs("backups", exist_ok=True)
+stamp=datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
+print(f"*** LIVE PUSH to theme {tid} — backups in backups/LIVE{tid}_*.{stamp}.bak ***")
+for lf,key in FILES.items():
+ want=open(lf,encoding="utf-8").read()
+ try: live=get(key)
+ except Exception: live=None
+ if live is not None:
+ bk=f"backups/LIVE{tid}_{key.replace('/','_')}.{stamp}.bak"
+ open(bk,"w",encoding="utf-8").write(live)
+ print(f"backup: {bk} ({len(live)} bytes)")
+ if live==want:
+ print(f"skip : {key} (already current)"); continue
+ st=put(key,want); time.sleep(0.6)
+ ver=get(key)
+ ok=ver.replace("\r\n","\n").strip()==want.replace("\r\n","\n").strip()
+ print(f"PUT : {key} HTTP {st} verify={'OK' if ok else 'MISMATCH'} ({len(want)} bytes)")
+ if not ok: print(f" *** verify mismatch on {key}"); sys.exit(1)
+print()
+print(f"DONE on LIVE theme {tid}.")
+print("REVERT: PUT each backups/LIVE{tid}_*.{stamp}.bak back to its key.")
+PY
← fafab4ef Boost infinite-scroll override: force boostSDAppConfig pagin
·
back to Designer Wallcoverings
·
Add reusable dry-run-gated refresh-product-image.sh + hi-res 63cc17b9 →