fix: validate CaseRun service routing

This commit is contained in:
root
2026-07-24 15:09:56 +02:00
parent b0000ecf41
commit 9fa8199162
+2 -2
View File
@@ -17,9 +17,9 @@ if (argv[0] === "tasktree") {
} else if (argv[0] === "caserun") {
const { caserunNativeServiceCommand, caserunNativeServicesCommand } = await import("../../src/caserun-native-service.ts");
try {
const result = ["start", "stop", "restart", "status", "logs"].includes(argv[2] ?? "") && argv[3] === undefined
const result = argv[1] === "service" && ["start", "stop", "restart", "status", "logs"].includes(argv[2] ?? "") && argv[3] === undefined
? await caserunNativeServicesCommand({ action: argv[2], cwd: process.cwd(), env: process.env })
: await caserunNativeServiceCommand({ service: argv[2] ?? "", action: argv[3] ?? "status", cwd: process.cwd(), env: process.env });
: await caserunNativeServiceCommand({ service: argv[1] === "service" ? argv[2] ?? "" : "", action: argv[1] === "service" ? argv[3] ?? "status" : "status", cwd: process.cwd(), env: process.env });
console.log(JSON.stringify(result, null, 2));
process.exitCode = result?.ok === false ? 1 : 0;
} catch (error: any) {