(configurationPath: string)
| 187 | } |
| 188 | |
| 189 | async function getSshConfigSource(configurationPath: string): Promise<string> { |
| 190 | configurationPath = resolveHome(configurationPath); |
| 191 | try { |
| 192 | const buffer: Buffer = await fs.readFile(configurationPath); |
| 193 | return buffer.toString('utf8'); |
| 194 | } catch (e) { |
| 195 | parseFailures.set(configurationPath, true); |
| 196 | if ((e as NodeJS.ErrnoException).code === 'ENOENT') { |
| 197 | return ''; |
| 198 | } |
| 199 | getSshChannel().appendLine(localize("failed.to.read.file", "Failed to read file {0}.", configurationPath)); |
| 200 | } |
| 201 | |
| 202 | return ''; |
| 203 | } |
| 204 | |
| 205 | function isDirective(c: ConfigurationEntry): c is ConfigurationDirective { |
| 206 | return c.type === ConfigurationEntryType.Directive; |
no test coverage detected