Skip to content

Commit 3497219

Browse files
committed
Use unzipToDirectoryConcurrently instead of the unzipper package
1 parent 4450237 commit 3497219

File tree

4 files changed

+7
-157
lines changed

4 files changed

+7
-157
lines changed

extensions/ql-vscode/package-lock.json

Lines changed: 1 addition & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,6 @@
20312031
"@types/tar-stream": "^3.1.3",
20322032
"@types/through2": "^2.0.36",
20332033
"@types/tmp": "^0.2.6",
2034-
"@types/unzipper": "^0.10.1",
20352034
"@types/vscode": "^1.82.0",
20362035
"@types/yauzl": "^2.10.3",
20372036
"@typescript-eslint/eslint-plugin": "^6.19.0",
@@ -2081,8 +2080,7 @@
20812080
"ts-loader": "^9.4.2",
20822081
"ts-node": "^10.7.0",
20832082
"ts-unused-exports": "^10.0.0",
2084-
"typescript": "^5.0.2",
2085-
"unzipper": "^0.10.14"
2083+
"typescript": "^5.0.2"
20862084
},
20872085
"lint-staged": {
20882086
"./**/*.{json,css,scss}": [

extensions/ql-vscode/src/databases/local-databases/database-origin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface DatabaseOriginDebugger {
2424
type: "debugger";
2525
}
2626

27-
export interface DatabaseOriginTestProj {
27+
interface DatabaseOriginTestProj {
2828
type: "testproj";
2929
path: string;
3030
}

extensions/ql-vscode/test/vscode-tests/cli-integration/jest.setup.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { createWriteStream, existsSync, mkdirpSync } from "fs-extra";
99
import { dirname, join } from "path";
1010
import { DB_URL, dbLoc, testprojLoc } from "../global.helper";
1111
import fetch from "node-fetch";
12-
import { createReadStream, renameSync } from "fs";
13-
import { Extract } from "unzipper";
12+
import { renameSync } from "fs";
13+
import { unzipToDirectoryConcurrently } from "../../../src/common/unzip-concurrently";
1414

1515
beforeAll(async () => {
1616
// ensure the test database is downloaded
@@ -36,18 +36,9 @@ beforeAll(async () => {
3636
// unzip the database from dbLoc to testprojLoc
3737
if (!existsSync(testprojLoc)) {
3838
console.log(`Unzipping test database to ${testprojLoc}`);
39-
40-
await new Promise((resolve, reject) => {
41-
createReadStream(dbLoc)
42-
.pipe(Extract({ path: dbParentDir }))
43-
.on("close", () => {
44-
console.log("Unzip completed.");
45-
resolve(undefined);
46-
})
47-
.on("error", (e) => reject(e));
48-
});
49-
39+
await unzipToDirectoryConcurrently(dbLoc, dbParentDir);
5040
renameSync(join(dbParentDir, "db"), testprojLoc);
41+
console.log("Unzip completed.");
5142
}
5243

5344
await beforeAllAction();

0 commit comments

Comments
 (0)