#!/usr/bin/env node /** * Setup script: creates config.json from example if it doesn't exist. * Runs during build phase. */ const fs = require('fs') const path = require('path') const projectRoot = path.join(__dirname, '..') const configPath = path.join(projectRoot, 'src', 'config', 'config.json') const examplePath = path.join(projectRoot, 'src', 'config', 'config.json.example') // Check if config.json exists if (fs.existsSync(configPath)) { console.log('✓ config.json found') process.exit(0) } // Check if example exists if (!fs.existsSync(examplePath)) { console.error('✗ config.json.example not found at', examplePath) process.exit(1) } // Copy example to config.json try { const exampleContent = fs.readFileSync(examplePath, 'utf8') fs.writeFileSync(configPath, exampleContent) console.log('✓ config.json created from example') process.exit(0) } catch (err) { console.error('✗ Failed to create config.json:', err.message) process.exit(1) }