Skip to content

Commit 764cd96

Browse files
committed
1 parent 6850012 commit 764cd96

6 files changed

Lines changed: 9 additions & 14 deletions

File tree

src/tsconfig.strictNullChecks.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@
319319
"./vs/platform/menubar/node/menubarIpc.ts",
320320
"./vs/platform/node/package.ts",
321321
"./vs/platform/node/product.ts",
322-
"./vs/platform/node/test/zip.test.ts",
323-
"./vs/platform/node/zip.ts",
324322
"./vs/platform/notification/common/notification.ts",
325323
"./vs/platform/notification/test/common/testNotificationService.ts",
326324
"./vs/platform/opener/common/opener.ts",
File renamed without changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
import * as assert from 'assert';
77
import * as path from 'vs/base/common/path';
88
import * as os from 'os';
9-
import { extract } from 'vs/platform/node/zip';
9+
import { extract } from 'vs/base/node/zip';
1010
import { generateUuid } from 'vs/base/common/uuid';
1111
import { rimraf, exists } from 'vs/base/node/pfs';
12-
import { NullLogService } from 'vs/platform/log/common/log';
1312
import { getPathFromAmdModule } from 'vs/base/common/amd';
1413
import { createCancelablePromise } from 'vs/base/common/async';
1514

@@ -21,7 +20,7 @@ suite('Zip', () => {
2120
const fixture = path.join(fixtures, 'extract.zip');
2221
const target = path.join(os.tmpdir(), generateUuid());
2322

24-
return createCancelablePromise(token => extract(fixture, target, {}, new NullLogService(), token)
23+
return createCancelablePromise(token => extract(fixture, target, {}, token)
2524
.then(() => exists(path.join(target, 'extension')))
2625
.then(exists => assert(exists))
2726
.then(() => rimraf(target)));
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ import { nfcall, ninvoke, Sequencer, createCancelablePromise } from 'vs/base/com
1111
import { mkdirp, rimraf } from 'vs/base/node/pfs';
1212
import { open as _openZip, Entry, ZipFile } from 'yauzl';
1313
import * as yazl from 'yazl';
14-
import { ILogService } from 'vs/platform/log/common/log';
1514
import { CancellationToken } from 'vs/base/common/cancellation';
1615
import { Event } from 'vs/base/common/event';
1716

1817
export interface IExtractOptions {
1918
overwrite?: boolean;
2019

21-
/**
20+
/**
2221
* Source path within the ZIP archive. Only the files contained in this
2322
* path will be extracted.
2423
*/
@@ -104,12 +103,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
104103
}));
105104
}
106105

107-
function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, logService: ILogService, token: CancellationToken): Promise<void> {
106+
function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, token: CancellationToken): Promise<void> {
108107
let last = createCancelablePromise<void>(() => Promise.resolve());
109108
let extractedEntriesCount = 0;
110109

111110
Event.once(token.onCancellationRequested)(() => {
112-
logService.debug(targetPath, 'Cancelled.');
113111
last.cancel();
114112
zipfile.close();
115113
});
@@ -195,7 +193,7 @@ export function zip(zipPath: string, files: IFile[]): Promise<string> {
195193
});
196194
}
197195

198-
export function extract(zipPath: string, targetPath: string, options: IExtractOptions = {}, logService: ILogService, token: CancellationToken): Promise<void> {
196+
export function extract(zipPath: string, targetPath: string, options: IExtractOptions = {}, token: CancellationToken): Promise<void> {
199197
const sourcePathRegex = new RegExp(options.sourcePath ? `^${options.sourcePath}` : '');
200198

201199
let promise = openZip(zipPath, true);
@@ -204,7 +202,7 @@ export function extract(zipPath: string, targetPath: string, options: IExtractOp
204202
promise = promise.then(zipfile => rimraf(targetPath).then(() => zipfile));
205203
}
206204

207-
return promise.then(zipfile => extractZip(zipfile, targetPath, { sourcePathRegex }, logService, token));
205+
return promise.then(zipfile => extractZip(zipfile, targetPath, { sourcePathRegex }, token));
208206
}
209207

210208
function read(zipPath: string, filePath: string): Promise<Readable> {

src/vs/platform/extensionManagement/node/extensionManagementService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as pfs from 'vs/base/node/pfs';
99
import { assign } from 'vs/base/common/objects';
1010
import { toDisposable, Disposable } from 'vs/base/common/lifecycle';
1111
import { flatten } from 'vs/base/common/arrays';
12-
import { extract, ExtractError, zip, IFile } from 'vs/platform/node/zip';
12+
import { extract, ExtractError, zip, IFile } from 'vs/base/node/zip';
1313
import {
1414
IExtensionManagementService, IExtensionGalleryService, ILocalExtension,
1515
IGalleryExtension, IGalleryMetadata,
@@ -472,7 +472,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
472472
this.logService.trace(`Started extracting the extension from ${zipPath} to ${extractPath}`);
473473
return pfs.rimraf(extractPath)
474474
.then(
475-
() => extract(zipPath, extractPath, { sourcePath: 'extension', overwrite: true }, this.logService, token)
475+
() => extract(zipPath, extractPath, { sourcePath: 'extension', overwrite: true }, token)
476476
.then(
477477
() => this.logService.info(`Extracted extension to ${extractPath}:`, identifier.id),
478478
e => pfs.rimraf(extractPath).finally(() => null)

src/vs/platform/extensionManagement/node/extensionManagementUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { buffer } from 'vs/platform/node/zip';
6+
import { buffer } from 'vs/base/node/zip';
77
import { localize } from 'vs/nls';
88
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
99

0 commit comments

Comments
 (0)