[object Object]

← back to Designer Wallcoverings

TK-11786: fail-loud --apply/--dry-run guards on push + single-variant-pricing scripts

a939ff3d488865109b7a35ceec72359c26714068 · 2026-09-22 13:35:26 -0700 · Steve

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3ChReG53fwpNgUESv4SY7

Files touched

Diff

commit a939ff3d488865109b7a35ceec72359c26714068
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Sep 22 13:35:26 2026 -0700

    TK-11786: fail-loud --apply/--dry-run guards on push + single-variant-pricing scripts
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01G3ChReG53fwpNgUESv4SY7
---
 DW-Programming/command54-shopify-push.js     | 6 ++++++
 DW-Programming/fix-single-variant-pricing.js | 2 +-
 DW-Programming/hollywood-shopify-push.js     | 6 ++++++
 DW-Programming/justindavid-shopify-push.js   | 6 ++++++
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/DW-Programming/command54-shopify-push.js b/DW-Programming/command54-shopify-push.js
index 7d43adf4..52a40197 100644
--- a/DW-Programming/command54-shopify-push.js
+++ b/DW-Programming/command54-shopify-push.js
@@ -782,6 +782,12 @@ function sendSlack(msg) {
 
 async function main() {
   const args = process.argv.slice(2);
+  // Consistency with the other bulk scripts: refuse to run with NEITHER flag — fail loud,
+  // never a silent dry no-op. (dryRun already defaults safe below; this just makes intent explicit.)
+  if (!args.includes('--apply') && !args.includes('--dry-run')) {
+    console.error('Refusing to run: pass --apply to WRITE or --dry-run to preview.');
+    process.exit(2);
+  }
   const dryRun = (args.includes('--dry-run') || !args.includes('--apply'));
   const reconcile = args.includes('--reconcile');
   const status = args.includes('--status');
diff --git a/DW-Programming/fix-single-variant-pricing.js b/DW-Programming/fix-single-variant-pricing.js
index ef0eaf9a..4bb96d80 100644
--- a/DW-Programming/fix-single-variant-pricing.js
+++ b/DW-Programming/fix-single-variant-pricing.js
@@ -390,7 +390,7 @@ async function main() {
     console.error('Refusing to run: pass --apply to WRITE or --dry-run to preview.');
     process.exit(2);
   }
-  const DRY_RUN = !args.includes('--apply');
+  const DRY_RUN = (args.includes('--dry-run') || !args.includes('--apply'));
   const LIMIT = args.find(a => a.startsWith('--limit='));
   const maxProducts = LIMIT ? parseInt(LIMIT.split('=')[1]) : Infinity;
 
diff --git a/DW-Programming/hollywood-shopify-push.js b/DW-Programming/hollywood-shopify-push.js
index c413e658..8411fb72 100644
--- a/DW-Programming/hollywood-shopify-push.js
+++ b/DW-Programming/hollywood-shopify-push.js
@@ -626,6 +626,12 @@ function sendSlack(msg) {
 
 async function main() {
   const args = process.argv.slice(2);
+  // Consistency with the other bulk scripts: refuse to run with NEITHER flag — fail loud,
+  // never a silent dry no-op. (dryRun already defaults safe below; this just makes intent explicit.)
+  if (!args.includes('--apply') && !args.includes('--dry-run')) {
+    console.error('Refusing to run: pass --apply to WRITE or --dry-run to preview.');
+    process.exit(2);
+  }
   const dryRun = (args.includes('--dry-run') || !args.includes('--apply'));
   const reconcile = args.includes('--reconcile');
   const status = args.includes('--status');
diff --git a/DW-Programming/justindavid-shopify-push.js b/DW-Programming/justindavid-shopify-push.js
index bc46b8a6..f394deb5 100644
--- a/DW-Programming/justindavid-shopify-push.js
+++ b/DW-Programming/justindavid-shopify-push.js
@@ -597,6 +597,12 @@ function sendSlack(msg) {
 
 async function main() {
   const args = process.argv.slice(2);
+  // Consistency with the other bulk scripts: refuse to run with NEITHER flag — fail loud,
+  // never a silent dry no-op. (dryRun already defaults safe below; this just makes intent explicit.)
+  if (!args.includes('--apply') && !args.includes('--dry-run')) {
+    console.error('Refusing to run: pass --apply to WRITE or --dry-run to preview.');
+    process.exit(2);
+  }
   const dryRun = (args.includes('--dry-run') || !args.includes('--apply'));
   const reconcile = args.includes('--reconcile');
   const status = args.includes('--status');

← 82c219e2 TK-11783: strip hardcoded Google OAuth client secret from sh  ·  back to Designer Wallcoverings  ·  TK-11786: scraper fixes — anna-french null-byte sentinel, sl 008592bf →