Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

tick(0) should not be the same as tick() #5

Merged
merged 1 commit into from

2 participants

@angel333

I noticed that progress bars are shown on the first tick. The problem is that e.g. for a db migration script which i'm now creating, the db commands are sent, than there is a huge (like 10 seconds) pause, and after that pause, the progress is finally shown. I wanted the progress bar to be shown immediately, even if it shows 0%. However, when I tried tick(0), it was considered as tick(), which I think is wrong.

It's very easy to fix, please see the commit attached.

Thank you for a great library, btw!

@tj tj merged commit a10eaee into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 10, 2012
  1. @angel333
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/node-progress.js
View
3  lib/node-progress.js
@@ -67,7 +67,8 @@ function ProgressBar(fmt, options) {
*/
ProgressBar.prototype.tick = function(len, tokens){
- len = len || 1;
+ if (len !== 0)
+ len = len || 1;
// swap tokens
if ('object' == typeof len) tokens = len, len = 1;
Something went wrong with that request. Please try again.