From d421664d1ff2934d123831e884fc802f6daebc07 Mon Sep 17 00:00:00 2001 From: Caleb Brose <5447118+cmbrose@users.noreply.github.com> Date: Sun, 17 Jul 2022 01:19:42 +0000 Subject: [PATCH] reduce diff --- pkg/cmd/codespace/ssh.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 25a674ba4..80737d664 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -141,11 +141,9 @@ func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err e return fmt.Errorf("failed to generate ssh keys: %w", err) } - if keyPair != nil { - startSSHOptions.UserPublicKeyFile = keyPair.PublicKeyPath - // For both cp and ssh, flags need to come first in the args (before a command in ssh and files in cp), so prepend this flag - args = append([]string{"-i", keyPair.PrivateKeyPath}, args...) - } + startSSHOptions.UserPublicKeyFile = keyPair.PublicKeyPath + // For both cp and ssh, flags need to come first in the args (before a command in ssh and files in cp), so prepend this flag + args = append([]string{"-i", keyPair.PrivateKeyPath}, args...) } codespace, err := getOrChooseCodespace(ctx, a.apiClient, opts.codespace)