MCPcopy Create free account
hub / github.com/cli/cli / isolatedEnvironment

Function isolatedEnvironment

evals/src/core/io.ts:40–61  ·  view source on GitHub ↗
(home: string, path: string, modelToken: string)

Source from the content-addressed store, hash-verified

38}
39
40export function isolatedEnvironment(home: string, path: string, modelToken: string): NodeJS.ProcessEnv {
41 return {
42 HOME: home,
43 USERPROFILE: home,
44 TMPDIR: join(home, "tmp"),
45 XDG_CONFIG_HOME: join(home, ".config"),
46 XDG_CACHE_HOME: join(home, ".cache"),
47 XDG_DATA_HOME: join(home, ".local/share"),
48 GH_CONFIG_DIR: join(home, ".config/gh"),
49 COPILOT_HOME: join(home, ".copilot"),
50 COPILOT_CLI: "1",
51 COPILOT_GITHUB_TOKEN: modelToken,
52 GIT_CONFIG_NOSYSTEM: "1",
53 GIT_CONFIG_GLOBAL: join(home, ".gitconfig"),
54 GIT_TERMINAL_PROMPT: "0",
55 GCM_INTERACTIVE: "never",
56 PATH: path,
57 LANG: "en_US.UTF-8",
58 TERM: "dumb",
59 NO_COLOR: "1",
60 };
61}
62
63export async function git(workDir: string, env: NodeJS.ProcessEnv, ...args: string[]): Promise<string> {
64 const { stdout } = await exec("git", args, { cwd: workDir, env, timeout: 30_000, maxBuffer: 2 * 1024 * 1024 });

Callers 4

observedProcessFunction · 0.85
harness.test.tsFile · 0.85
prepareHomeFunction · 0.85
copilotReviewerFunction · 0.85

Calls

no outgoing calls

Tested by 1

observedProcessFunction · 0.68