1
0
Fork 0
mirror of https://github.com/sbrl/terrain50-cli.git synced 2024-06-10 08:34:55 +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;
await next.serialise(stream_out, is_last);
let percentage = percentage(i - offset, count);
process.stderr.write(`Written ${i - offset} / count objects (~${count.toFixed(2)}%) \r`);
if(is_last) break;
process.stderr.write(`Written ${i - offset} / count objects (~${percentage(i - offset, count).toFixed(2)}%) \r`);
}
l.log(`Slicing complete`);
stream_in.close();
}