Skip to content

Commit

Permalink
Proper fix parsing multiple include directives
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Sep 20, 2023
1 parent ec3323b commit 19e0ae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ssh/sshConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ async function parseSSHConfigFromFile(filePath: string, userConfig: boolean) {
const line = config[i];
if (isIncludeDirective(line)) {
const values = (line.value as string).split(',').map(s => s.trim());
const configs: SSHConfig[] = [];
for (const value of values) {
const includePaths = await glob(normalizeToSlash(untildify(value)), {
absolute: true,
cwd: normalizeToSlash(path.dirname(userConfig ? defaultSSHConfigPath : systemSSHConfig))
});
const configs: SSHConfig[] = [];
for (const p of includePaths) {
configs.push(await parseSSHConfigFromFile(p, userConfig));
}
includedConfigs.push([i, configs]);
}
includedConfigs.push([i, configs]);
}
}
for (const [idx, includeConfigs] of includedConfigs.reverse()) {
Expand Down

0 comments on commit 19e0ae6

Please sign in to comment.