reduce diff

This commit is contained in:
Caleb Brose 2022-07-17 01:19:42 +00:00 committed by GitHub
parent 6c9d1a9fd4
commit d421664d1f

View file

@ -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)