MCPcopy
hub / github.com/openclaw/clawsweeper / windowsSystemExecutable

Function windowsSystemExecutable

src/codex-spawn.ts:136–143  ·  view source on GitHub ↗
(name: string, env: NodeJS.ProcessEnv)

Source from the content-addressed store, hash-verified

134}
135
136function windowsSystemExecutable(name: string, env: NodeJS.ProcessEnv): string {
137 const systemRoot =
138 windowsEnvironmentValue(env, "SystemRoot") || windowsEnvironmentValue(env, "windir");
139 if (systemRoot) return join(systemRoot, "System32", name);
140 const comSpec = windowsEnvironmentValue(env, "ComSpec");
141 if (comSpec && isAbsolute(comSpec)) return join(dirname(comSpec), name);
142 throw new Error(`Unable to resolve Windows system executable: ${name}`);
143}
144
145function windowsEnvironmentValue(env: NodeJS.ProcessEnv, name: string): string | undefined {
146 const entry = Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase());

Callers 2

codexSpawnInvocationFunction · 0.85

Calls 1

windowsEnvironmentValueFunction · 0.85

Tested by

no test coverage detected