UNPKG

fatsoma-sync

Version:

Sync Fatsoma events with configurable DesignMyNight booking links

31 lines (24 loc) 875 B
#!/usr/bin/env node const fs = require("fs"); const path = require("path"); const arg = process.argv[2]; if (arg === "init") { const configPath = path.resolve(process.cwd(), "fatsoma.config.js"); if (fs.existsSync(configPath)) { console.log("✅ fatsoma.config.js already exists."); process.exit(0); } const template = `// Auto-generated by fatsoma-sync module.exports = { fatsomaVenueId: "PASTE_YOUR_FATSOMA_VENUE_ID_HERE", dmnVenueId: "PASTE_YOUR_DMN_VENUE_ID_HERE", drinksBookingType: "PASTE_DRINKS_BOOKING_TYPE_ID_HERE", foodBookingType: "PASTE_FOOD_BOOKING_TYPE_ID_HERE", returnUrl: "https://yourwebsite.com/booking-complete", };`; fs.writeFileSync(configPath, template); console.log("✅ Created fatsoma.config.js — now fill it in."); } else { console.log("❌ Unknown command. Try: npx fatsoma-sync init"); process.exit(1); }