1
0
Fork 0
mirror of https://github.com/sbrl/terrain50-cli.git synced 2024-11-23 07:03:01 +00:00

stream-slice: fix percentage calculation

This commit is contained in:
Starbeamrainbowlabs 2020-07-02 17:19:27 +01:00
parent 071e46abb0
commit 80dbe4696e
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -41,8 +41,11 @@ export default async function(settings) {
let is_last = i - offset >= count; let is_last = i - offset >= count;
await next.serialise(stream_out, is_last); await next.serialise(stream_out, is_last);
let percentage = percentage(i - offset, count); if(is_last) break;
process.stderr.write(`Written ${i - offset} / count objects (~${count.toFixed(2)}%) \r`);
process.stderr.write(`Written ${i - offset} / count objects (~${percentage(i - offset, count).toFixed(2)}%) \r`);
} }
l.log(`Slicing complete`); l.log(`Slicing complete`);
stream_in.close();
} }