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

Commit 0d9db37

Browse files
KevinEdrycmoog
andauthored
fixed ssh key error to better reflect its state. (#139)
Fix config-ssh key file error to better reflect its state Co-authored-by: Charles Moog <moogcharlie@gmail.com>
1 parent a878b98 commit 0d9db37

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/cmd/configssh.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ func configSSH(configpath *string, remove *bool) func(cmd *cobra.Command, _ []st
130130
}
131131
err = writeSSHKey(ctx, client, privateKeyFilepath)
132132
if err != nil {
133-
return xerrors.Errorf("fetch and write ssh key: %w", err)
133+
fmt.Printf("Your private ssh key already exists at \"%s\"\nYou may need to remove the existing file and re-run this command\n", privateKeyFilepath)
134+
} else {
135+
fmt.Printf("Your private ssh key was written to \"%s\"\n", privateKeyFilepath)
134136
}
135137

136138
fmt.Printf("An auto-generated ssh config was written to \"%s\"\n", *configpath)
137-
fmt.Printf("Your private ssh key was written to \"%s\"\n", privateKeyFilepath)
138139
fmt.Println("You should now be able to ssh into your environment")
139140
fmt.Printf("For example, try running\n\n\t$ ssh coder.%s\n\n", envs[0].Name)
140141
return nil

0 commit comments

Comments
 (0)