UNPKG

@five-vm/cli

Version:

High-performance CLI for Five VM development with WebAssembly integration

45 lines (36 loc) 1.25 kB
#!/usr/bin/env node /** * Five CLI Post-Install Script * * Sets up CLI after installation and checks for WASM modules */ import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); function main() { console.log('🚀 Five CLI post-install setup...'); // Check if WASM modules exist const wasmDir = path.join(__dirname, '..', 'assets', 'vm'); const wasmExists = fs.existsSync(path.join(wasmDir, 'five_vm_wasm.js')); if (wasmExists) { console.log('✅ Five VM WASM modules found'); } else { console.log('⚠️ Five VM WASM modules not found'); console.log(' Run "npm run build:vm-wasm" to build WASM modules'); } // Make CLI binary executable const binaryPath = path.join(__dirname, '..', 'bin', 'five.js'); if (fs.existsSync(binaryPath)) { try { fs.chmodSync(binaryPath, '755'); console.log('✅ CLI binary made executable'); } catch (error) { console.log('⚠️ Could not make binary executable:', error.message); } } console.log('🎉 Five CLI installation complete!'); console.log(' Use "five --help" to get started'); } main();