From 0820b5ef5239e5e9667e001e87b0ed0a00858b24 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Sun, 13 Sep 2020 12:00:14 -0700 Subject: [PATCH] Fix build and debug active file with no .vscode folder on Linux/Mac. (#6130) --- Extension/src/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 0339cec0d3..ede5104f28 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -676,8 +676,8 @@ export function writeFileText(filePath: string, content: string, encoding: strin const folders: string[] = filePath.split(path.sep).slice(0, -1); if (folders.length) { // create folder path if it doesn't exist - folders.reduce((last, folder) => { - const folderPath: string = last ? last + path.sep + folder : folder; + folders.reduce((previous, folder) => { + const folderPath: string = previous + path.sep + folder; if (!fs.existsSync(folderPath)) { fs.mkdirSync(folderPath); }