Skip to content

Commit c42240f

Browse files
committed
fix(lib/vscode): refactor mkdirp to fs.promises
They removed mkdirp in favor of fs.promises. Updated in marketplace.ts
1 parent 350ddc3 commit c42240f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/vscode/src/vs/server/node/marketplace.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as path from 'path';
33
import * as tarStream from 'tar-stream';
44
import * as util from 'util';
55
import { CancellationToken } from 'vs/base/common/cancellation';
6-
import { mkdirp } from 'vs/base/node/pfs';
76
import * as vszip from 'vs/base/node/zip';
87
import * as nls from 'vs/nls';
98
import product from 'vs/platform/product/common/product';
@@ -133,7 +132,12 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract
133132
const fileName = rawName.replace(sourcePathRegex, '');
134133
const targetFileName = path.join(targetPath, fileName);
135134
if (/\/$/.test(fileName)) {
136-
return mkdirp(targetFileName).then(nextEntry);
135+
/*
136+
NOTE:@coder: they removed mkdirp in favor of fs.promises
137+
See commit: https://github.com/microsoft/vscode/commit/a0d76bb9834b63a02fba8017a6306511fe1ab4fe#diff-2bf233effbb62ea789bb7c4739d222a43ccd97ed9f1219f75bb07e9dee91c1a7
138+
3/11/21 @jsjoeio
139+
*/
140+
return fs.promises.mkdir(targetFileName).then(nextEntry)
137141
}
138142

139143
const dirName = path.dirname(fileName);
@@ -142,7 +146,12 @@ const extractTar = async (tarPath: string, targetPath: string, options: IExtract
142146
return fail(new Error(nls.localize('invalid file', 'Error extracting {0}. Invalid file.', fileName)));
143147
}
144148

145-
await mkdirp(targetDirName, undefined);
149+
/*
150+
NOTE:@coder: they removed mkdirp in favor of fs.promises
151+
See commit: https://github.com/microsoft/vscode/commit/a0d76bb9834b63a02fba8017a6306511fe1ab4fe#diff-2bf233effbb62ea789bb7c4739d222a43ccd97ed9f1219f75bb07e9dee91c1a7
152+
3/11/21 @jsjoeio
153+
*/
154+
await fs.promises.mkdir(targetDirName)
146155

147156
const fstream = fs.createWriteStream(targetFileName, { mode: header.mode });
148157
fstream.once('close', () => next());

0 commit comments

Comments
 (0)