Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] removed progressbar from row output #356

  • Loading branch information...
commit 2d11c97b23fb7696ded2bf68359d589f1ad86bb5 1 parent 723c6f5
@blakmatrix blakmatrix authored
Showing with 33 additions and 24 deletions.
  1. +33 −24 lib/jitsu/package.js
View
57 lib/jitsu/package.js
@@ -422,36 +422,45 @@ package.updateTarball = function (version, pkg, existing, firstSnapshot, callbac
jitsu.log.warn('This is not recommended practice.');
}
- var emitter = jitsu.snapshots.create(pkg.name, version, filename, function (err, snapshots) {
- jitsu.log.silly('Done creating snapshot ' + version.magenta);
- return err ? callback(err) : callback(null, version, pkg);
- });
-
- if(emitter) {
- var size;
- emitter.on('start', function(stats) {
- size = stats.size;
- bar = new ProgressBar('info'.green + '\t Uploading: [:bar] :percent',{
- complete : '=',
- incomplete: ' ',
- width : 30 ,
- total : stats.size
- });
+ if(!jitsu.config.get('raw')) {
+ var emitter = jitsu.snapshots.create(pkg.name, version, filename, function (err, snapshots) {
+ jitsu.log.silly('Done creating snapshot ' + version.magenta);
+ return err ? callback(err) : callback(null, version, pkg);
});
+
+ if(emitter) {
+ var size;
+ emitter.on('start', function(stats) {
+ size = stats.size;
+ bar = new ProgressBar('info'.green + '\t Uploading: [:bar] :percent',{
+ complete : '=',
+ incomplete: ' ',
+ width : 30 ,
+ total : stats.size
+ });
+ });
- emitter.on('data', function(length) {
- if(bar) bar.tick(length > size ? size : length);
- });
+ emitter.on('data', function(length) {
+ if(bar) { bar.tick(length > size ? size : length); }
+ });
- emitter.on('end', function() {
- // fix for bar that sometimes hangs at 99%
- if(bar) {
- bar.tick(bar.total - bar.curr);
- }
+ emitter.on('end', function() {
+ // fix for bar that sometimes hangs at 99%
+ if(bar) {
+ bar.tick(bar.total - bar.curr);
+ }
- console.log();
+ console.log();
+ });
+ }
+
+ } else {
+ jitsu.snapshots.create(pkg.name, version, filename, function (err, snapshots) {
+ jitsu.log.silly('Done creating snapshot ' + version.magenta);
+ return err ? callback(err) : callback(null, version, pkg);
});
}
+
});
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.