(configurationPath: string, resolveIncludes: boolean = true)
| 82 | * @returns |
| 83 | */ |
| 84 | export async function getSshConfiguration(configurationPath: string, resolveIncludes: boolean = true): Promise<Configuration> { |
| 85 | parseFailures.set(configurationPath, false); |
| 86 | const src: string = await getSshConfigSource(configurationPath); |
| 87 | let parsedSrc: Configuration | undefined; |
| 88 | try { |
| 89 | parsedSrc = parse(src); |
| 90 | } catch (err) { |
| 91 | parseFailures.set(configurationPath, true); |
| 92 | getSshChannel().appendLine(localize("failed.to.parse.SSH.config", "Failed to parse SSH configuration file {0}: {1}", configurationPath, (err as Error).message)); |
| 93 | return parse(''); |
| 94 | } |
| 95 | const config: Configuration = caseNormalizeConfigProps(parsedSrc); |
| 96 | if (resolveIncludes) { |
| 97 | await resolveConfigIncludes(config, configurationPath); |
| 98 | } |
| 99 | return config; |
| 100 | } |
| 101 | |
| 102 | function getProcessedPathKey(filePath: string): string { |
| 103 | const absolutePath: string = path.resolve(filePath); |
no test coverage detected