Skip to content

Commit

Permalink
Keep updating bar
Browse files Browse the repository at this point in the history
This lets the times (duration) update even when progress does not. :)
  • Loading branch information
jsg2021 committed May 28, 2019
1 parent 4d03654 commit 1ee2b71
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ module.exports = function ProgressBarPlugin(options) {

var newPercent = Math.floor(percent * barOptions.width);

if (lastPercent < newPercent || newPercent === 0) {
bar.update(percent, {
msg: msg
});
lastPercent = newPercent;
if (lastPercent < percent || newPercent === 0) {
lastPercent = percent;
}

bar.update(percent, {
msg: msg
});

if (!running) {
running = true;
Expand Down

0 comments on commit 1ee2b71

Please sign in to comment.