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); }