Skip to content

Commit 3c3af24

Browse files
authored
core: respect "~" in ssh config (#849)
1 parent f36ff1e commit 3c3af24

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/app.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,14 @@ func generateSSHConfig(modifySSHConfig bool) error {
497497
continue
498498
}
499499

500-
if words[0] == "Include" && words[1] == sshFileColima {
501-
// already present
502-
return nil
500+
if words[0] == "Include" {
501+
sshConfig := words[1]
502+
sshConfig = strings.Replace(sshConfig, "~/", "$HOME/", 1)
503+
sshConfig = os.ExpandEnv(sshConfig)
504+
if sshConfig == sshFileColima {
505+
// already present
506+
return nil
507+
}
503508
}
504509
}
505510

0 commit comments

Comments
 (0)