Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix] _bytesDispatched sometimes is bigger than packages for small pa…

…ckages.. that crashes the progressBar
  • Loading branch information...
commit c2a6fe20567f327102a2864555463cab7f91ef07 1 parent c941daa
@yawnt yawnt authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/jitsu/package.js
View
4 lib/jitsu/package.js
@@ -428,7 +428,9 @@ package.updateTarball = function (version, pkg, existing, firstSnapshot, callbac
});
if(emitter) {
+ var size;
emitter.on('start', function(stats) {
+ size = stats.size;
bar = new ProgressBar('info'.green + '\t Uploading: [:bar] :percent',{
complete : '=',
incomplete: ' ',
@@ -438,7 +440,7 @@ package.updateTarball = function (version, pkg, existing, firstSnapshot, callbac
});
emitter.on('data', function(length) {
- if(bar) bar.tick(length);
+ if(bar) bar.tick(length > size ? size : length);
});
emitter.on('end', function() {
Please sign in to comment.
Something went wrong with that request. Please try again.