MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getSshConfigSource

Function getSshConfigSource

Extension/src/SSH/sshHosts.ts:189–203  ·  view source on GitHub ↗
(configurationPath: string)

Source from the content-addressed store, hash-verified

187}
188
189async 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
205function isDirective(c: ConfigurationEntry): c is ConfigurationDirective {
206 return c.type === ConfigurationEntryType.Directive;

Callers 1

getSshConfigurationFunction · 0.85

Calls 5

resolveHomeFunction · 0.90
getSshChannelFunction · 0.90
toStringMethod · 0.80
appendLineMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected