@@ -56,7 +56,7 @@ describe("ssh config", () => {
5656 } ) . pipe ( Effect . provide ( NodeServices . layer ) , Effect . scoped ) ,
5757 ) ;
5858
59- it . effect ( "skips directory Include matches without losing file aliases or known hosts " , ( ) =>
59+ it . effect ( "skips directories and implicit dotfile Include matches but keeps explicit ones " , ( ) =>
6060 Effect . gen ( function * ( ) {
6161 const fs = yield * FileSystem . FileSystem ;
6262 const path = yield * Path . Path ;
@@ -66,12 +66,24 @@ describe("ssh config", () => {
6666 yield * fs . makeDirectory ( path . join ( sshDir , "explicit-directory" ) ) ;
6767 yield * fs . writeFileString (
6868 path . join ( sshDir , "config" ) ,
69- "Include config.d/*\nInclude explicit-directory\nHost real\n HostName real.example.com\n" ,
69+ "Include config.d/*\nInclude config.d/.literal.conf\nInclude config.d/.enabled-*.conf\nInclude explicit-directory\nHost real\n HostName real.example.com\n" ,
7070 ) ;
7171 yield * fs . writeFileString (
7272 path . join ( sshDir , "config.d" , "team.conf" ) ,
7373 "Host team\n HostName team.example.com\n" ,
7474 ) ;
75+ yield * fs . writeFileString (
76+ path . join ( sshDir , "config.d" , ".backup.conf" ) ,
77+ "Host *\n HostName obsolete.example.com\n" ,
78+ ) ;
79+ yield * fs . writeFileString (
80+ path . join ( sshDir , "config.d" , ".literal.conf" ) ,
81+ "Host literal\n HostName literal.example.com\n" ,
82+ ) ;
83+ yield * fs . writeFileString (
84+ path . join ( sshDir , "config.d" , ".enabled-one.conf" ) ,
85+ "Host enabled\n HostName enabled.example.com\n" ,
86+ ) ;
7587 yield * fs . writeFileString (
7688 path . join ( sshDir , "known_hosts" ) ,
7789 "known.example.com ssh-ed25519 AAAA\n" ,
@@ -81,7 +93,9 @@ describe("ssh config", () => {
8193 assert . deepEqual (
8294 hosts . map ( ( host ) => [ host . alias , host . hostname , host . source ] ) ,
8395 [
96+ [ "enabled" , "enabled.example.com" , "ssh-config" ] ,
8497 [ "known.example.com" , "known.example.com" , "known-hosts" ] ,
98+ [ "literal" , "literal.example.com" , "ssh-config" ] ,
8599 [ "real" , "real.example.com" , "ssh-config" ] ,
86100 [ "team" , "team.example.com" , "ssh-config" ] ,
87101 ] ,
0 commit comments