From 49851daf0dceda6c4c9f3fe5998348ce0c488c9b Mon Sep 17 00:00:00 2001 From: Amir Omidi Date: Tue, 24 Sep 2019 15:45:48 -0700 Subject: [PATCH] Don't check if directory exists (#7349) --- extensions/azurecore/src/extension.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/extensions/azurecore/src/extension.ts b/extensions/azurecore/src/extension.ts index 0f795d73db..0946a88979 100644 --- a/extensions/azurecore/src/extension.ts +++ b/extensions/azurecore/src/extension.ts @@ -82,23 +82,12 @@ export async function activate(context: vscode.ExtensionContext) { }; } -async function exists(path: string): Promise { - try { - await fs.access(path); - return true; - } catch (e) { - return false; - } -} - // Create the folder for storing the token caches async function findOrMakeStoragePath() { let storagePath = path.join(getDefaultLogLocation(), constants.extensionName); try { - if (!(await exists(storagePath))) { - await fs.mkdir(storagePath); - console.log('Initialized Azure account extension storage.'); - } + await fs.mkdir(storagePath, { recursive: true }); + console.log('Initialized Azure account extension storage.'); } catch (e) { console.error(`Initialization of Azure account extension storage failed: ${e}`);