Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[fix] _bytesDispatched #345

Closed
wants to merge 1 commit into from

2 participants

@yawnt

bytesDispatched sometimes is a bigger number than the package's size, and that crashes the progressBar

@AvianFlu

Already merged, stupid github.

@AvianFlu AvianFlu closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2012
  1. @yawnt

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

    yawnt authored
    …ckages.. that crashes the progressBar
This page is out of date. Refresh to see the latest.
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() {
Something went wrong with that request. Please try again.