From c42240f182a8751081ba8fe2b6d0d9b52a1c1943 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 11 Mar 2021 15:10:42 -0700 Subject: [PATCH] fix(lib/vscode): refactor mkdirp to fs.promises They removed mkdirp in favor of fs.promises. Updated in marketplace.ts --- lib/vscode/src/vs/server/node/marketplace.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/vscode/src/vs/server/node/marketplace.ts b/lib/vscode/src/vs/server/node/marketplace.ts index 8956fc40..b280a87c 100644 --- a/lib/vscode/src/vs/server/node/marketplace.ts +++ b/lib/vscode/src/vs/server/node/marketplace.ts @@ -3,7 +3,6 @@ import * as path from 'path'; import * as tarStream from 'tar-stream'; import * as util from 'util'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { mkdirp } from 'vs/base/node/pfs'; import * as vszip from 'vs/base/node/zip'; import * as nls from 'vs/nls'; import product from 'vs/platform/product/common/product'; @@ -133,7 +132,12 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract const fileName = rawName.replace(sourcePathRegex, ''); const targetFileName = path.join(targetPath, fileName); if (/\/$/.test(fileName)) { - return mkdirp(targetFileName).then(nextEntry); + /* + NOTE:@coder: they removed mkdirp in favor of fs.promises + See commit: https://github.com/microsoft/vscode/commit/a0d76bb9834b63a02fba8017a6306511fe1ab4fe#diff-2bf233effbb62ea789bb7c4739d222a43ccd97ed9f1219f75bb07e9dee91c1a7 + 3/11/21 @jsjoeio + */ + return fs.promises.mkdir(targetFileName).then(nextEntry) } const dirName = path.dirname(fileName); @@ -142,7 +146,12 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract return fail(new Error(nls.localize('invalid file', 'Error extracting {0}. Invalid file.', fileName))); } - await mkdirp(targetDirName, undefined); + /* + NOTE:@coder: they removed mkdirp in favor of fs.promises + See commit: https://github.com/microsoft/vscode/commit/a0d76bb9834b63a02fba8017a6306511fe1ab4fe#diff-2bf233effbb62ea789bb7c4739d222a43ccd97ed9f1219f75bb07e9dee91c1a7 + 3/11/21 @jsjoeio + */ + await fs.promises.mkdir(targetDirName) const fstream = fs.createWriteStream(targetFileName, { mode: header.mode }); fstream.once('close', () => next());