Commit 1c27109b9155b4dd90f5068566dfc45b92a17f82
Ensure progress bar doesn't interfere with debug output
Charles Lehner committed on 2/19/2016, 7:26:55 PMParent: 61ec87e541fec1873ca242b614d0c4be2ad6385e
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -147,9 +147,15 @@ | ||
147 | 147 | } |
148 | 148 | |
149 | 149 | // through stream to show a progress bar for objects being read |
150 | 150 | function progressObjects(options) { |
151 | - if (!options.progress) return function (readObject) { return readObject } | |
151 | + // Only show progress bar if it is requested and if it won't interfere with | |
152 | + // the debug output | |
153 | + if (!options.progress || options.verbosity > 1) { | |
154 | + var dummyProgress = function (readObject) { return readObject } | |
155 | + dummyProgress.setNumObjects = function () {} | |
156 | + return dummyProgress | |
157 | + } | |
152 | 158 | |
153 | 159 | var numObjects |
154 | 160 | var size = process.stderr.columns - 5 |
155 | 161 | var bar = new ProgressBar(':percent :bar', { total: size }) |
Built with git-ssb-web