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:`;