fix(cli): Fix internal imports, centralize IPC types and improve daemon entry/start behavior
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { startDaemon } from './tspm.daemon.js';
|
||||
/**
|
||||
* Daemon entry point - runs process management server
|
||||
* This should only be run directly by the CLI or as a systemd service
|
||||
*/
|
||||
|
||||
// Start the daemon
|
||||
startDaemon().catch((error) => {
|
||||
console.error('Failed to start daemon:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
export { startDaemon } from './tspm.daemon.js';
|
||||
|
||||
// When executed directly (not imported), start the daemon
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
import('./tspm.daemon.js').then(({ startDaemon }) => {
|
||||
startDaemon().catch((error) => {
|
||||
console.error('Failed to start daemon:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user