// Sync portable/ -> u-claw-app/ before dev/build. // Single source of truth lives under portable/ (used by Windows-Start.bat, // Mac-Start.command, and config-server). The Electron desktop app embeds a // runtime copy because asar packaging cannot reach across siblings. const fs = require('node:fs'); const path = require('node:path'); const APP_DIR = path.resolve(__dirname, '..'); const PORTABLE_DIR = path.resolve(APP_DIR, '..', 'portable'); const COPIES = [ // The settings UI has one implementation: config-server/public/index.html. // portable/Config.html is only a redirect shim for the old file:// entry point. { from: path.join(PORTABLE_DIR, 'config-server', 'public', 'index.html'), to: path.join(APP_DIR, 'resources', 'Config.html') }, ]; for (const { from, to } of COPIES) { if (!fs.existsSync(from)) { console.error(`[sync-lib] Missing ${from}`); process.exit(1); } fs.mkdirSync(path.dirname(to), { recursive: true }); fs.copyFileSync(from, to); console.log(`[sync-lib] ${path.relative(APP_DIR, to)}`); }