forked from lessweb/deepcode-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
22 lines (17 loc) · 658 Bytes
/
Copy pathstart.js
File metadata and controls
22 lines (17 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { existsSync } from "node:fs";
import { spawn } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, "..");
const cliDist = join(root, "packages", "cli", "dist", "cli.js");
if (!existsSync(cliDist)) {
console.error(`Error: ${cliDist} not found. Run 'npm run build' first.`);
process.exit(1);
}
console.log("Starting Deep Code CLI...\n");
const child = spawn("node", [cliDist, ...process.argv.slice(2)], {
stdio: "inherit",
cwd: root,
});
child.on("exit", (code) => process.exit(code ?? 1));