Skip to content

Commit

Permalink
download progress for NS
Browse files Browse the repository at this point in the history
However in megabytes, and I don't know math very well, I just know
(bytes / 1024 / 1024) gives megabytes, if you know a better simpler way
to convert this make a PR, please...
  • Loading branch information
0neGal committed Jan 3, 2022
1 parent deeffb8 commit ea8e9ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ function update() {
https.get(body.assets[0].browser_download_url, (res) => {
let stream = fs.createWriteStream(settings.zip);
res.pipe(stream);

let received = 0;
res.on("data", (chunk) => {
received += chunk.length;
winLog(lang("gui.update.downloading") + " " + (received / 1024 / 1024).toFixed(1) + "mb");
})

stream.on("finish", () => {
stream.close();
winLog(lang("gui.update.extracting"));
Expand Down

0 comments on commit ea8e9ac

Please sign in to comment.