Skip to content

Commit

Permalink
fix: not matched sections should not present in compute result (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjake authored Feb 1, 2023
1 parent 82a840b commit c67eb69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ssh-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class SSHConfig extends Array<Line> {
setProperty(subline.param, subline.value)
}
}
} else {
} else if (line.param !== 'Host' && line.param !== 'Match') {
setProperty(line.param, line.value)
}
}
Expand Down
1 change: 1 addition & 0 deletions test/unit/ssh-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('SSHConfig', function() {
const result = config.compute('tahoe1')
assert.ok(result)
assert.equal(result.HostName, 'tahoe.com')
assert.equal(result.Match, undefined)
})

it('compute by Match exec', async function() {
Expand Down

0 comments on commit c67eb69

Please sign in to comment.