← back to Designerwallcoverings
data/google-feed/arm-gmc-real-errors.sh
36 lines
#!/usr/bin/env bash
# arm-gmc-real-errors.sh — STEVE-GATED. Unpublishes ONLY the 2,596 genuinely-broken
# Google listings (roll_price_below_floor + no_image + below_kravet_map_* + private_label_leak)
# from the Google & YouTube channel. Does NOT touch the 26,350 sample-only products
# (held in hold-sample-only.csv — a separate strategic decision, per TK-00066 review 2026-07-28).
# Fully reversible (re-publish). Nothing runs until Steve executes this file.
#
# cd ~/Projects/designerwallcoverings && bash data/google-feed/arm-gmc-real-errors.sh
#
set -euo pipefail
cd "$HOME/Projects/designerwallcoverings"
GF="data/google-feed"
LIVE="$GF/unpublish-list.csv"
ERRORS="$GF/unpublish-real-errors.csv"
STAMP="$(date +%Y%m%d-%H%M%S)"
[ -f "$ERRORS" ] || { echo "FATAL: $ERRORS missing — re-run the split first."; exit 1; }
N=$(($(wc -l < "$ERRORS") - 1))
echo "[arm-gmc] scoped list = $N products (real errors only; sample-only NOT included)."
# sanity: refuse if the 'scoped' list somehow ballooned toward the full catalog
[ "$N" -le 5000 ] || { echo "FATAL: scoped list is $N (>5000) — that is NOT the surgical set. Abort."; exit 1; }
cp "$LIVE" "$GF/unpublish-list.FULL.$STAMP.bak.csv"
cp "$ERRORS" "$LIVE"
echo "[arm-gmc] full list backed up → unpublish-list.FULL.$STAMP.bak.csv ; scoped list swapped in."
set +e
node scripts/google-feed/apply-unpublish.mjs --apply --i-am-steve --reason=TK-00066-real-errors-only
RC=$?
set -e
cp "$GF/unpublish-list.FULL.$STAMP.bak.csv" "$LIVE"
echo "[arm-gmc] full list restored. apply exit=$RC."
echo "[arm-gmc] REVERSE: re-publish the affected products to the Google & YouTube channel (publication 29646651457)."
exit $RC