Fix: Daemon startup and Qwen CLI path for Windows
This commit is contained in:
50
src/index.ts
50
src/index.ts
@@ -7,20 +7,38 @@ import { send } from "./commands/send";
|
||||
const args = process.argv.slice(2);
|
||||
const command = args[0];
|
||||
|
||||
if (command === "--stop-all") {
|
||||
stopAll();
|
||||
} else if (command === "--stop") {
|
||||
stop();
|
||||
} else if (command === "--clear") {
|
||||
clear();
|
||||
} else if (command === "start") {
|
||||
start(args.slice(1));
|
||||
} else if (command === "status") {
|
||||
status();
|
||||
} else if (command === "telegram") {
|
||||
telegram();
|
||||
} else if (command === "send") {
|
||||
send(args.slice(1));
|
||||
} else {
|
||||
start();
|
||||
async function main() {
|
||||
console.log("[QwenClaw] Index.ts - Command:", command);
|
||||
|
||||
if (command === "--stop-all") {
|
||||
await stopAll();
|
||||
} else if (command === "--stop") {
|
||||
await stop();
|
||||
} else if (command === "--clear") {
|
||||
await clear();
|
||||
} else if (command === "start") {
|
||||
console.log("[QwenClaw] Calling start function...");
|
||||
await start(args.slice(1));
|
||||
console.log("[QwenClaw] Start function returned");
|
||||
} else if (command === "status") {
|
||||
await status();
|
||||
} else if (command === "telegram") {
|
||||
await telegram();
|
||||
} else if (command === "send") {
|
||||
await send(args.slice(1));
|
||||
} else {
|
||||
console.log("[QwenClaw] No command, starting default...");
|
||||
await start();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error("[QwenClaw] Fatal error:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// Keep process alive
|
||||
process.on('SIGINT', () => {
|
||||
console.log('[QwenClaw] Received SIGINT, shutting down...');
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user