From dba51160690c8bf243dc532989d332ed49429746 Mon Sep 17 00:00:00 2001 From: musistudio Date: Fri, 26 Dec 2025 13:33:17 +0800 Subject: [PATCH] fix ccr start error --- packages/cli/src/utils/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/utils/index.ts b/packages/cli/src/utils/index.ts index 206ba12..b50ee6e 100644 --- a/packages/cli/src/utils/index.ts +++ b/packages/cli/src/utils/index.ts @@ -14,7 +14,7 @@ import { writeFileSync, existsSync, readFileSync } from "fs"; import { checkForUpdates, performUpdate } from "./update"; import { version } from "../../package.json"; import { spawn } from "child_process"; -import { cleanupPidFile } from "./processCheck"; +import {cleanupPidFile, isServiceRunning} from "./processCheck"; // Function to interpolate environment variables in config values const interpolateEnvVars = (obj: any): any => { @@ -180,6 +180,11 @@ export const initConfig = async () => { }; export const run = async (args: string[] = []) => { + const isRunning = isServiceRunning() + if (isRunning) { + console.log('claude-code-router server is running'); + return; + } const server = await getServer(); // Save the PID of the background process writeFileSync(PID_FILE, process.pid.toString());