← back to Designer Wallcoverings
fix Slack webhook crash (inline-fetch variant): 3 unwrapped push/import scripts short-circuit-guarded; fleet unwrapped-crashers now 0
4298ac979be53fc43e7f6e3af49b3333e5491e11 · 2026-07-07 06:30:56 -0700 · steve
Files touched
M scripts/import-fmpro-to-postgres.jsM scripts/push-mfr-to-shopify.jsM scripts/supplier-mfr-bulk-push.js
Diff
commit 4298ac979be53fc43e7f6e3af49b3333e5491e11
Author: steve <steve@designerwallcoverings.com>
Date: Tue Jul 7 06:30:56 2026 -0700
fix Slack webhook crash (inline-fetch variant): 3 unwrapped push/import scripts short-circuit-guarded; fleet unwrapped-crashers now 0
---
scripts/import-fmpro-to-postgres.js | 2 +-
scripts/push-mfr-to-shopify.js | 2 +-
scripts/supplier-mfr-bulk-push.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/import-fmpro-to-postgres.js b/scripts/import-fmpro-to-postgres.js
index ed1d7f5b..061d177d 100644
--- a/scripts/import-fmpro-to-postgres.js
+++ b/scripts/import-fmpro-to-postgres.js
@@ -103,7 +103,7 @@ async function run() {
console.log(` Duration: ${Math.round((Date.now() - startTime) / 1000)}s`);
// Slack
- fetch('${SLACK_WEBHOOK_URL}', {
+ process.env.SLACK_WEBHOOK_URL && fetch(process.env.SLACK_WEBHOOK_URL, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `✅ *FMPro Import*: ${s.crossref} records, ${s.matched} Shopify matches, ${updateResult.rowCount} updated, ${pct}% coverage` })
}).catch(() => {});
diff --git a/scripts/push-mfr-to-shopify.js b/scripts/push-mfr-to-shopify.js
index 56228671..6fe83d05 100644
--- a/scripts/push-mfr-to-shopify.js
+++ b/scripts/push-mfr-to-shopify.js
@@ -78,7 +78,7 @@ async function run() {
console.log(`\n🏁 Done! Updated: ${updated}, Failed: ${failed}, Duration: ${duration}min`);
// Slack
- fetch('${SLACK_WEBHOOK_URL}', {
+ process.env.SLACK_WEBHOOK_URL && fetch(process.env.SLACK_WEBHOOK_URL, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `✅ *MFR Push to Shopify*: ${updated} products updated, ${failed} failed, ${duration}min` })
}).catch(() => {});
diff --git a/scripts/supplier-mfr-bulk-push.js b/scripts/supplier-mfr-bulk-push.js
index 0b075b96..5746148e 100644
--- a/scripts/supplier-mfr-bulk-push.js
+++ b/scripts/supplier-mfr-bulk-push.js
@@ -84,7 +84,7 @@ async function run() {
console.log(`\n🏁 Done! Updated: ${updated}, Failed: ${failed}, Duration: ${duration}min`);
// Slack notification
- await fetch('${SLACK_WEBHOOK_URL}', {
+ await process.env.SLACK_WEBHOOK_URL && fetch(process.env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `🔥 *Supplier + MFR Bulk Push Complete*\n• Updated: ${updated}\n• Failed: ${failed}\n• Duration: ${duration} min` })
← 98dd515a fix Slack webhook crash: 66 DW scripts had literal '${SLACK_
·
back to Designer Wallcoverings
·
Carl Robinson viewer: wire to local images + persist out of e968f838 →