From 382f9e52e6ef5f2e9f89be64dc1fa97ad1b776b4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 23 Sep 2020 09:01:13 +0200 Subject: [PATCH] #105047 simplify --- src/vs/workbench/api/node/extHostOutputService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/node/extHostOutputService.ts b/src/vs/workbench/api/node/extHostOutputService.ts index c7da758e4cc..aad00356e37 100644 --- a/src/vs/workbench/api/node/extHostOutputService.ts +++ b/src/vs/workbench/api/node/extHostOutputService.ts @@ -85,9 +85,12 @@ export class ExtHostOutputService2 extends ExtHostOutputService { private async _doCreateOutChannel(name: string): Promise { try { const outputDirPath = join(this._logsLocation.fsPath, `output_logging_${toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')}`); - const outputDir = await dirExists(outputDirPath).then(exists => exists || mkdirp(outputDirPath).then(() => true)).then(() => outputDirPath); + const exists = await dirExists(outputDirPath); + if (!exists) { + await mkdirp(outputDirPath); + } const fileName = `${this._namePool++}-${name.replace(/[\\/:\*\?"<>\|]/g, '')}`; - const file = URI.file(join(outputDir, `${fileName}.log`)); + const file = URI.file(join(outputDirPath, `${fileName}.log`)); const appender = new OutputAppender(fileName, file.fsPath); return new ExtHostOutputChannelBackedByFile(name, appender, this._proxy); } catch (error) {