From bc418ff422d62b49196aaf7a26c5df563c688f75 Mon Sep 17 00:00:00 2001 From: Carl Hultay <144816337+crhultay@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:08:05 -0500 Subject: [PATCH] Update oputil_ssh_key.js per feedback --- core/oputil/oputil_ssh_key.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/oputil/oputil_ssh_key.js b/core/oputil/oputil_ssh_key.js index a227ef27..00ba8367 100644 --- a/core/oputil/oputil_ssh_key.js +++ b/core/oputil/oputil_ssh_key.js @@ -105,10 +105,8 @@ function createNew(cb) { ui.log.write(`Creating SSH Key: ${targetKeyFile}`); // Create Dir - if (!fs.pathExists(sshKeyPath)) { - ui.log.write(`Creating Directory: ${sshKeyPath}`); - exec(`mkdir -p ${sshKeyPath}`); - } + ui.log.write(`Creating Directory: ${sshKeyPath}`); + fs.ensureDirSync(sshKeyPath); // Create SSH Keys const command = `openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537 | openssl rsa -out ./${targetKeyFile} -aes128 -traditional -passout pass:`;