@exreve/exk 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +31 -0
- package/dist/ttc-cli.tar.gz +0 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2586,6 +2586,34 @@ program
|
|
|
2586
2586
|
execSync(`pm2 start "${exkBin}" --name cli --interpreter none -- daemon`, {
|
|
2587
2587
|
stdio: 'inherit'
|
|
2588
2588
|
});
|
|
2589
|
+
// Configure pm2 to start on boot (creates systemd/launchd service)
|
|
2590
|
+
let startupConfigured = false;
|
|
2591
|
+
try {
|
|
2592
|
+
const startupResult = execSync('pm2 startup 2>&1', { encoding: 'utf-8' });
|
|
2593
|
+
if (startupResult.includes('sudo') || startupResult.includes('[PM2] You have to run')) {
|
|
2594
|
+
// pm2 startup needs sudo - try running the suggested command
|
|
2595
|
+
const match = startupResult.match(/(sudo .+)/);
|
|
2596
|
+
if (match) {
|
|
2597
|
+
console.log('\n⚙ PM2 startup requires admin privileges.');
|
|
2598
|
+
console.log('Run this command to enable auto-start on reboot:');
|
|
2599
|
+
console.log(` ${match[1]}`);
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
else {
|
|
2603
|
+
startupConfigured = true;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
catch (err) {
|
|
2607
|
+
const execErr = err;
|
|
2608
|
+
const output = execErr.stderr || '';
|
|
2609
|
+
const match = output.match(/(sudo .+)/);
|
|
2610
|
+
if (match) {
|
|
2611
|
+
console.log('\n⚙ PM2 startup requires admin privileges.');
|
|
2612
|
+
console.log('Run this command to enable auto-start on reboot:');
|
|
2613
|
+
console.log(` ${match[1]}`);
|
|
2614
|
+
}
|
|
2615
|
+
// Non-critical - pm2 startup may need sudo
|
|
2616
|
+
}
|
|
2589
2617
|
// Save pm2 process list for auto-restart on reboot
|
|
2590
2618
|
try {
|
|
2591
2619
|
execSync('pm2 save', { stdio: 'inherit' });
|
|
@@ -2595,6 +2623,9 @@ program
|
|
|
2595
2623
|
}
|
|
2596
2624
|
console.log('\n✓ exk installation complete!');
|
|
2597
2625
|
console.log('The service is now running in the background.');
|
|
2626
|
+
if (startupConfigured) {
|
|
2627
|
+
console.log('✓ Auto-start on reboot is configured.');
|
|
2628
|
+
}
|
|
2598
2629
|
console.log('\nUseful commands:');
|
|
2599
2630
|
console.log(' pm2 logs cli - View logs');
|
|
2600
2631
|
console.log(' pm2 restart cli - Restart service');
|
package/dist/ttc-cli.tar.gz
CHANGED
|
Binary file
|