adapt path and commands for Windows environment

This commit is contained in:
Hayaii
2025-07-13 15:36:59 +08:00
parent 8f8eeacc3d
commit 20e8a8f197
5 changed files with 1562 additions and 39 deletions

View File

@@ -7,6 +7,7 @@ import { version } from "../package.json";
import { spawn } from "child_process";
import { PID_FILE, REFERENCE_COUNT_FILE } from "./constants";
import { existsSync, readFileSync } from "fs";
import {join} from "path";
const command = process.argv[2];
@@ -78,7 +79,8 @@ async function main() {
case "code":
if (!isServiceRunning()) {
console.log("Service not running, starting service...");
const startProcess = spawn("ccr", ["start"], {
const cliPath = join(__dirname, "cli.js");
const startProcess = spawn("node", [cliPath, "start"], {
detached: true,
stdio: "ignore",
});