From fb660ead505342899705b96923f581fb2de79864 Mon Sep 17 00:00:00 2001 From: David Kolb Date: Tue, 17 Apr 2018 12:14:31 -0400 Subject: [PATCH] Fixing error when ~/.aws exists w/out cred file. --- lib/keys.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/keys.js b/lib/keys.js index 1903c86a..fe851346 100644 --- a/lib/keys.js +++ b/lib/keys.js @@ -77,7 +77,9 @@ function updateCreds(key, profile, force){ // in case the user never ran `aws configure`.. if(!fs.existsSync(credFile)){ - fs.mkdirSync(credPath); + if(!fs.existsSync(credPath)) { + fs.mkdirSync(credPath); + } fs.closeSync(fs.openSync(credFile, 'w')); }