forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare-runtime.ts
More file actions
16 lines (15 loc) · 760 Bytes
/
Copy pathprepare-runtime.ts
File metadata and controls
16 lines (15 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { join } from "node:path";
import { getRuntimePlatform, materializeRuntimeBundle } from "../src/runtimeArtifacts.js";
import { COPILOT_CLI_VERSION } from "../src/cliVersion.js";
import { ensureCopilotPackage } from "./releaseArtifacts.js";
const [option] = process.argv.slice(2);
const platform = getRuntimePlatform();
const packageRoot = await ensureCopilotPackage(COPILOT_CLI_VERSION, { platform });
if (option === "--print-legacy-path") {
process.stdout.write(`${join(packageRoot, "app.js")}\n`);
} else if (option === "--print-path" || option === undefined) {
const runtimePath = materializeRuntimeBundle({ packageRoot, platform });
process.stdout.write(`${runtimePath}\n`);
} else {
throw new Error(`Unknown option: ${option}`);
}