Monorepo for Aesthetic.Computer aesthetic.computer
at main 66 lines 1.8 kB view raw
1#!/usr/bin/env node 2/** 3 * Simple launcher for the Ableton Live Timeline Viewer 4 * 5 * This script automatically finds and runs the viewer with the extracted XML file. 6 * Just run: npm run timeline 7 */ 8 9import { spawn } from 'node:child_process'; 10import { existsSync } from 'node:fs'; 11import { resolve, dirname } from 'node:path'; 12import { fileURLToPath } from 'node:url'; 13 14const __dirname = dirname(fileURLToPath(import.meta.url)); 15 16// Try to find the XML file in common locations 17const possiblePaths = [ 18 resolve(__dirname, '../system/public/assets/wipppps/zzzZWAP_extracted.xml'), 19 '/Users/jas/Desktop/code/aesthetic-computer/system/public/assets/wipppps/zzzZWAP_extracted.xml', 20 './zzzZWAP_extracted.xml', 21 process.argv[2] // Allow override via command line 22].filter(Boolean); 23 24function findXMLFile() { 25 for (const path of possiblePaths) { 26 if (existsSync(path)) { 27 return path; 28 } 29 } 30 return null; 31} 32 33function main() { 34 console.log('🎵 Starting Ableton Live Timeline Viewer...\n'); 35 36 const xmlFile = findXMLFile(); 37 38 if (!xmlFile) { 39 console.error('❌ Could not find zzzZWAP_extracted.xml'); 40 console.log('Tried the following locations:'); 41 possiblePaths.forEach(path => console.log(` - ${path}`)); 42 console.log('\nUsage: npm run timeline [path-to-extracted.xml]'); 43 process.exit(1); 44 } 45 46 console.log(`✅ Found XML file: ${xmlFile}\n`); 47 48 // Launch the viewer 49 const viewer = spawn('node', [resolve(__dirname, 'ableton-live-viewer.mjs'), xmlFile], { 50 stdio: 'inherit', 51 cwd: __dirname 52 }); 53 54 viewer.on('error', (error) => { 55 console.error('❌ Failed to start viewer:', error.message); 56 process.exit(1); 57 }); 58 59 viewer.on('exit', (code) => { 60 process.exit(code || 0); 61 }); 62} 63 64if (import.meta.url === `file://${process.argv[1]}`) { 65 main(); 66}