We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2331f93 commit 8b809f8Copy full SHA for 8b809f8
cmd/get.go
@@ -126,10 +126,14 @@ var getCmd = &cobra.Command{
126
remove.Write([]byte("\n"))
127
}
128
129
- c = exec.Command("ssh-add", "-D")
130
- c.Stdin = &remove
131
- if err := c.Run(); err != nil {
132
- return fmt.Errorf("could not remove old authentication keys from the agent: %w", err)
+ if remove.Len() > 0 {
+ c = exec.Command("ssh-add", "-d", "-")
+ c.Stdin = bytes.NewReader(remove.Bytes())
+ c.Stdout = os.Stdout
133
+ c.Stderr = os.Stderr
134
+ if err := c.Run(); err != nil {
135
+ return fmt.Errorf("could not remove old authentication keys from the agent: %w", err)
136
+ }
137
138
139
c = exec.Command("ssh-add", privKeyPath)
0 commit comments