Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency webpack to v5 #135

Merged
merged 4 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"typescript": "4.2.4",
"ts-loader": "8.1.0",
"vscode": "1.1.37",
"webpack": "4.46.0",
"webpack": "5.31.0",
"webpack-cli": "3.3.12"
},
"dependencies": {
Expand Down
15 changes: 9 additions & 6 deletions src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function download2(
return new Promise(async (resolve, reject) => {
let response;
for (let i = 0; i < MaxRedirects; ++i) {
response = await new Promise<IncomingMessage>(resolve => https.get(srcUrl, resolve));
response = await new Promise<IncomingMessage>((resolve) => https.get(srcUrl, resolve));
if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
srcUrl = response.headers.location;
} else {
Expand All @@ -54,7 +54,7 @@ export async function download2(
: null;
let downloaded = 0;
let old_downloaded = 0;
response.on('data', chunk => {
response.on('data', (chunk) => {
old_downloaded = downloaded;
downloaded += chunk.length;
progress(downloaded, contentLength, old_downloaded);
Expand Down Expand Up @@ -160,13 +160,16 @@ export function getDestPath(context: vscode.ExtensionContext): string {
}

async function ensureDirectory(dir: string) {
let exists = await new Promise(resolve => fs.exists(dir, exists => resolve(exists)));
let exists = await new Promise((resolve) => fs.exists(dir, (exists) => resolve(exists)));
if (!exists) {
await ensureDirectory(path.dirname(dir));
await new Promise((resolve, reject) =>
fs.mkdir(dir, err => {
if (err) reject(err);
else resolve();
fs.mkdir(dir, (err) => {
if (err) {
reject(err);
} else {
resolve(true);
}
})
);
}
Expand Down
Loading