From 85d0702110001be573050fee0d6d7003a2a81404 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 26 Jun 2023 20:11:38 +0000 Subject: [PATCH] fix: do not recreate key if public key don't exist --- keygen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keygen.go b/keygen.go index 37b5ce3..625b275 100644 --- a/keygen.go +++ b/keygen.go @@ -480,7 +480,7 @@ func (s *SSHKeyPair) WriteKeys() error { // KeyPairExists checks if the SSH key pair exists on disk. func (s *SSHKeyPair) KeyPairExists() bool { - return fileExists(s.privateKeyPath()) && fileExists(s.publicKeyPath()) + return fileExists(s.privateKeyPath()) } func writeKeyToFile(keyBytes []byte, path string) error {