const fs = require('fs');

const envPath = 'vibn-frontend/.env.local';

let content = fs.existsSync(envPath) ? fs.readFileSync(envPath, 'utf8') : '';

if (!content.includes('STRIPE_CLIENT_ID')) {
  content += `\nSTRIPE_CLIENT_ID=ca_UTuWw2qE8wFLNlWOL7T1v0H5GdB6BtDw\n`;
  fs.writeFileSync(envPath, content);
  console.log("✅ Successfully added STRIPE_CLIENT_ID to .env.local!");
} else {
  // Replace it just in case
  content = content.replace(/STRIPE_CLIENT_ID=.*/, 'STRIPE_CLIENT_ID=ca_UTuWw2qE8wFLNlWOL7T1v0H5GdB6BtDw');
  fs.writeFileSync(envPath, content);
  console.log("✅ Successfully updated STRIPE_CLIENT_ID in .env.local!");
}

