← back to CelebritySignatures
printify-cost-check: support bucket-hat + crew-socks + --yes non-interactive flag
ba964569ed6ced5078bbd631ffc1532c99e2b1b3 · 2026-09-09 16:27:02 -0700 · Steve
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
M scripts/printify-cost-check.mjs
Diff
commit ba964569ed6ced5078bbd631ffc1532c99e2b1b3
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Sep 9 16:27:02 2026 -0700
printify-cost-check: support bucket-hat + crew-socks + --yes non-interactive flag
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
scripts/printify-cost-check.mjs | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/scripts/printify-cost-check.mjs b/scripts/printify-cost-check.mjs
index 5ed014c..35ea895 100644
--- a/scripts/printify-cost-check.mjs
+++ b/scripts/printify-cost-check.mjs
@@ -42,24 +42,23 @@ async function req(method, path, body) {
return { status: r.status, ok: r.ok, body: j };
}
-// Override via CLI: node scripts/printify-cost-check.mjs [x] [y] [scale] [tee|polo|both]
-const argX = parseFloat(process.argv[2]);
-const argY = parseFloat(process.argv[3]);
-const argScale = parseFloat(process.argv[4]);
-const which = process.argv[5] || 'both';
-const PRINT_POSITION = {
- placeholder: 'front',
- scale: isNaN(argScale) ? 0.25 : argScale,
- x: isNaN(argX) ? 0.32 : argX,
- y: isNaN(argY) ? 0.3 : argY,
-};
-console.log(`printPosition: x=${PRINT_POSITION.x} y=${PRINT_POSITION.y} scale=${PRINT_POSITION.scale}`);
-
+// CLI: node scripts/printify-cost-check.mjs [garment ...] [--yes]
+// garments: bucket-hat crew-socks classic-tee polo (default: bucket-hat crew-socks)
+// --yes : non-interactive — delete the throwaway product immediately, no Enter prompt.
+const NON_INTERACTIVE = process.argv.includes('--yes');
+const wanted = process.argv.slice(2).filter(a => a !== '--yes');
+// Each candidate carries its OWN placeholder + position. Cost is placement-INDEPENDENT,
+// but product creation requires a valid placeholder for that blueprint.
const ALL_CANDIDATES = [
- { garment: 'classic-tee', blueprintId: 12, printProviderId: 99, variantId: 18541, label: 'Bella+Canvas 3001 White/M' },
- { garment: 'polo', blueprintId: 1402, printProviderId: 99, variantId: 104648, label: 'JERZEES 443M Piqué Polo White/M' },
+ { garment: 'bucket-hat', blueprintId: 1698, printProviderId: 99, variantId: 116655, label: 'Bucket Hat bone/One size', pos: { placeholder: 'front', x: 0.5, y: 0.5, scale: 0.7 } },
+ { garment: 'crew-socks', blueprintId: 2941, printProviderId: 29, variantId: 155679, label: 'Crew Socks white/One size', pos: { placeholder: 'front', x: 0.5, y: 0.5, scale: 0.7 } },
+ { garment: 'classic-tee', blueprintId: 12, printProviderId: 99, variantId: 18541, label: 'Bella+Canvas 3001 White/M', pos: { placeholder: 'front', x: 0.32, y: 0.3, scale: 0.25 } },
+ { garment: 'polo', blueprintId: 1402, printProviderId: 99, variantId: 104648, label: 'JERZEES 443M Piqué Polo White/M', pos: { placeholder: 'front', x: 0.32, y: 0.3, scale: 0.25 } },
];
-const CANDIDATES = which === 'both' ? ALL_CANDIDATES : ALL_CANDIDATES.filter(c => c.garment.includes(which));
+const CANDIDATES = wanted.length
+ ? ALL_CANDIDATES.filter(c => wanted.includes(c.garment))
+ : ALL_CANDIDATES.filter(c => ['bucket-hat', 'crew-socks'].includes(c.garment));
+if (!CANDIDATES.length) { console.error('No matching garments. Options: bucket-hat crew-socks classic-tee polo'); process.exit(1); }
async function uploadImage() {
console.log('Uploading test signature image (Samuel Adams — public-domain-historical)...');
@@ -90,7 +89,7 @@ async function main() {
variants: [{ id: c.variantId, price: 3400, is_enabled: true }],
print_areas: [{
variant_ids: [c.variantId],
- placeholders: [{ position: PRINT_POSITION.placeholder, images: [{ id: imageId, x: PRINT_POSITION.x, y: PRINT_POSITION.y, scale: PRINT_POSITION.scale, angle: 0 }] }],
+ placeholders: [{ position: c.pos.placeholder, images: [{ id: imageId, x: c.pos.x, y: c.pos.y, scale: c.pos.scale, angle: 0 }] }],
}],
visible: false,
});
@@ -107,7 +106,7 @@ async function main() {
if (images.length) {
console.log(` MOCKUP IMAGES (open these to eyeball left-chest placement):`);
for (const img of images) console.log(` ${img.src}`);
- } else {
+ } else if (!NON_INTERACTIVE) {
console.log(' no mockup images returned yet — product is still live on your account (unpublished, id=' + productId + ').');
const rl = createInterface({ input: stdin, output: stdout });
await rl.question(' Check https://printify.com/app/products for the mockup now if you want, then press Enter to delete it and continue... ');
← 7489d97 signatures: serve the full-resolution original (vector SVG /
·
back to CelebritySignatures
·
wear: 'See it worn' — feature each celebrity's seated editor 523cb04 →