MCPcopy Index your code
hub / github.com/callstack/agent-device / resolveConfigPaths

Function resolveConfigPaths

src/utils/cli-config.ts:29–42  ·  view source on GitHub ↗
(
  cwd: string,
  explicitCliConfigPath: string | undefined,
  env: EnvMap,
)

Source from the content-addressed store, hash-verified

27}
28
29function resolveConfigPaths(
30 cwd: string,
31 explicitCliConfigPath: string | undefined,
32 env: EnvMap,
33): Array<{ path: string; required: boolean }> {
34 const explicitConfig = explicitCliConfigPath ?? env.AGENT_DEVICE_CONFIG;
35 if (explicitConfig) {
36 return [{ path: resolveInputPath(explicitConfig, cwd, env), required: true }];
37 }
38 return [
39 { path: resolveUserConfigPath(env), required: false },
40 { path: path.resolve(cwd, 'agent-device.json'), required: false },
41 ];
42}
43
44function resolveUserConfigPath(env: EnvMap): string {
45 return path.join(expandUserHomePath('~', { env }), '.agent-device', 'config.json');

Callers 1

Calls 2

resolveInputPathFunction · 0.85
resolveUserConfigPathFunction · 0.85

Tested by

no test coverage detected