( cwd: string, explicitCliConfigPath: string | undefined, env: EnvMap, )
| 27 | } |
| 28 | |
| 29 | function 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 | |
| 44 | function resolveUserConfigPath(env: EnvMap): string { |
| 45 | return path.join(expandUserHomePath('~', { env }), '.agent-device', 'config.json'); |
no test coverage detected