(
config: Configuration,
includePath: string,
processedIncludePaths: Set<string>,
processedIncludeEntries: WeakSet<ConfigurationDirective>
)
| 152 | } |
| 153 | |
| 154 | async function getIncludedConfigFile( |
| 155 | config: Configuration, |
| 156 | includePath: string, |
| 157 | processedIncludePaths: Set<string>, |
| 158 | processedIncludeEntries: WeakSet<ConfigurationDirective> |
| 159 | ): Promise<void> { |
| 160 | let includedContents: string; |
| 161 | try { |
| 162 | includedContents = (await fs.readFile(includePath)).toString(); |
| 163 | } catch { |
| 164 | getSshChannel().appendLine(localize("failed.to.read.file", "Failed to read file {0}.", includePath)); |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | let parsedIncludedContents: Configuration | undefined; |
| 169 | try { |
| 170 | parsedIncludedContents = parse(includedContents); |
| 171 | } catch (err) { |
| 172 | getSshChannel().appendLine(localize("failed.to.parse.SSH.config", "Failed to parse SSH configuration file {0}: {1}", includePath, (err as Error).message)); |
| 173 | return; |
| 174 | } |
| 175 | await resolveConfigIncludes(parsedIncludedContents, includePath, processedIncludePaths, processedIncludeEntries); |
| 176 | config.push(...parsedIncludedContents); |
| 177 | } |
| 178 | |
| 179 | export async function writeSshConfiguration(configurationPath: string, configuration: Configuration): Promise<void> { |
| 180 | configurationPath = resolveHome(configurationPath); |
no test coverage detected