Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit b2a4c96

Browse files
authored
fix: patch config-ssh panic condition (#210)
1 parent 84f8540 commit b2a4c96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/cmd/configssh.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ func removeOldConfig(config string) (string, bool) {
152152
if startIndex == -1 || endIndex == -1 {
153153
return config, false
154154
}
155-
config = config[:startIndex-1] + config[endIndex+len(sshEndToken)+1:]
156-
157-
return config, true
155+
if startIndex == 0 {
156+
return config[endIndex+len(sshEndToken)+1:], true
157+
}
158+
return config[:startIndex-1] + config[endIndex+len(sshEndToken)+1:], true
158159
}
159160

160161
// sshAvailable returns true if SSH is available for at least one environment.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy