diff options
author | Aleksey Kladov <[email protected]> | 2020-02-26 13:21:23 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-26 13:21:23 +0000 |
commit | 1f1bda2c5a1d897b39df7a936e14c31e74e1dfff (patch) | |
tree | a1c0eee91109b7e0662b3c28219dd70ed58f1311 /editors/code/src/installation | |
parent | 80f8e474a0c6a1cf477afc2141f9d6182f8b05a3 (diff) |
Remove unnecessary dep
Diffstat (limited to 'editors/code/src/installation')
-rw-r--r-- | editors/code/src/installation/download_artifact.ts | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/editors/code/src/installation/download_artifact.ts b/editors/code/src/installation/download_artifact.ts index 356723aba..8ed99bf0a 100644 --- a/editors/code/src/installation/download_artifact.ts +++ b/editors/code/src/installation/download_artifact.ts | |||
@@ -5,7 +5,6 @@ import { strict as assert } from "assert"; | |||
5 | 5 | ||
6 | import { ArtifactReleaseInfo } from "./interfaces"; | 6 | import { ArtifactReleaseInfo } from "./interfaces"; |
7 | import { downloadFile } from "./download_file"; | 7 | import { downloadFile } from "./download_file"; |
8 | import { throttle } from "throttle-debounce"; | ||
9 | 8 | ||
10 | /** | 9 | /** |
11 | * Downloads artifact from given `downloadUrl`. | 10 | * Downloads artifact from given `downloadUrl`. |
@@ -38,19 +37,15 @@ export async function downloadArtifact( | |||
38 | async (progress, _cancellationToken) => { | 37 | async (progress, _cancellationToken) => { |
39 | let lastPrecentage = 0; | 38 | let lastPrecentage = 0; |
40 | const filePermissions = 0o755; // (rwx, r_x, r_x) | 39 | const filePermissions = 0o755; // (rwx, r_x, r_x) |
41 | await downloadFile(downloadUrl, installationPath, filePermissions, throttle( | 40 | await downloadFile(downloadUrl, installationPath, filePermissions, (readBytes, totalBytes) => { |
42 | 200, | 41 | const newPercentage = (readBytes / totalBytes) * 100; |
43 | /* noTrailing: */ true, | 42 | progress.report({ |
44 | (readBytes, totalBytes) => { | 43 | message: newPercentage.toFixed(0) + "%", |
45 | const newPercentage = (readBytes / totalBytes) * 100; | 44 | increment: newPercentage - lastPrecentage |
46 | progress.report({ | 45 | }); |
47 | message: newPercentage.toFixed(0) + "%", | ||
48 | increment: newPercentage - lastPrecentage | ||
49 | }); | ||
50 | 46 | ||
51 | lastPrecentage = newPercentage; | 47 | lastPrecentage = newPercentage; |
52 | }) | 48 | }); |
53 | ); | ||
54 | } | 49 | } |
55 | ); | 50 | ); |
56 | } | 51 | } |