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

fixed ssh key error to better reflect its state. #139

Merged
merged 2 commits into from
Oct 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed ssh key error to better reflect its state
  • Loading branch information
Kevin Orel Edry committed Oct 17, 2020
commit 2178ea69fac4bdadb01e0decf6d32842d983d3ec
5 changes: 3 additions & 2 deletions internal/cmd/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ func configSSH(configpath *string, remove *bool) func(cmd *cobra.Command, _ []st
}
err = writeSSHKey(ctx, client, privateKeyFilepath)
if err != nil {
return xerrors.Errorf("fetch and write ssh key: %w", err)
fmt.Printf("Your private ssh key already exists at \"%s\"\n", privateKeyFilepath)
} else {
fmt.Printf("Your private ssh key was written to \"%s\"\n", privateKeyFilepath)
}

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