(
state: RemoteConnectionState,
options: {
cwd: string;
env: Record<string, string | undefined>;
validateRemoteConfigHash?: boolean;
},
)
| 223 | } |
| 224 | |
| 225 | function resolveConnectionProfile( |
| 226 | state: RemoteConnectionState, |
| 227 | options: { |
| 228 | cwd: string; |
| 229 | env: Record<string, string | undefined>; |
| 230 | validateRemoteConfigHash?: boolean; |
| 231 | }, |
| 232 | ): Partial<CliFlags> { |
| 233 | try { |
| 234 | return resolveRemoteConfigProfile({ |
| 235 | configPath: state.remoteConfigPath, |
| 236 | cwd: options.cwd, |
| 237 | env: options.env, |
| 238 | }).profile; |
| 239 | } catch (error) { |
| 240 | // Disconnect tolerates a missing/unparseable profile; other paths already failed hash checks. |
| 241 | if (options.validateRemoteConfigHash === false) { |
| 242 | return {}; |
| 243 | } |
| 244 | throw error; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | function writeJsonFile(filePath: string, value: unknown): void { |
| 249 | fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`, { |
no test coverage detected