| |
| |
| |
| |
|
|
| const fs = require('fs'); |
| const path = require('path'); |
|
|
| const MODULES_DIR = './modules'; |
| const OUTPUT_FILE = './script.js'; |
|
|
| |
| const moduleOrder = [ |
| 'CatOS-Core.js', |
| 'WindowManager.js', |
| 'AppManager.js', |
| 'EventHandler.js', |
| 'Terminal.js', |
| 'main.js' |
| ]; |
|
|
| function buildCatOS() { |
| console.log('π±βπ» Building CatOS...'); |
| |
| let combinedScript = ''; |
| |
| |
| combinedScript += `/** |
| * CatOS v9.0 (Whiskers Edition) - Combined Build |
| * Generated: ${new Date().toISOString()} |
| */\n\n`; |
| |
| |
| for (const moduleName of moduleOrder) { |
| const modulePath = path.join(MODULES_DIR, moduleName); |
| |
| if (fs.existsSync(modulePath)) { |
| console.log(`π Adding module: ${moduleName}`); |
| const moduleContent = fs.readFileSync(modulePath, 'utf8'); |
| |
| combinedScript += `// === ${moduleName} ===\n`; |
| combinedScript += moduleContent; |
| combinedScript += '\n\n'; |
| } else { |
| console.warn(`β οΈ Module not found: ${moduleName}`); |
| } |
| } |
| |
| |
| fs.writeFileSync(OUTPUT_FILE, combinedScript); |
| |
| console.log('β
Build complete!'); |
| console.log(`π¦ Output: ${OUTPUT_FILE}`); |
| console.log(`π Size: ${(fs.statSync(OUTPUT_FILE).size / 1024).toFixed(2)} KB`); |
| } |
|
|
| |
| if (require.main === module) { |
| buildCatOS(); |
| } |
|
|
| module.exports = { buildCatOS }; |