mirror of
https://github.com/GitFrog1111/badclaude.git
synced 2026-04-22 03:56:22 +02:00
33 lines
814 B
JavaScript
33 lines
814 B
JavaScript
#!/usr/bin/env node
|
|
const path = require('path');
|
|
const { spawn } = require('child_process');
|
|
|
|
const invokedAs = path.basename(process.argv[1] || '');
|
|
if (invokedAs === 'badclaude' || invokedAs === 'badclaude.cmd') {
|
|
console.warn('[DEPRECATED] "badclaude" has been renamed to "openwhip".');
|
|
console.warn('Please run: npm install -g openwhip');
|
|
}
|
|
|
|
let electronBinary;
|
|
try {
|
|
electronBinary = require('electron');
|
|
} catch (e) {
|
|
console.error('Could not load Electron. Try: npm install -g openwhip');
|
|
process.exit(1);
|
|
}
|
|
|
|
const appPath = path.resolve(__dirname, '..');
|
|
|
|
const child = spawn(electronBinary, [appPath], {
|
|
detached: true,
|
|
stdio: 'ignore',
|
|
windowsHide: true,
|
|
});
|
|
|
|
child.on('error', (err) => {
|
|
console.error('Failed to start openwhip:', err.message);
|
|
process.exit(1);
|
|
});
|
|
|
|
child.unref();
|