git ssb

0+

cel / pull-git-remote-helper



Commit 64608e3739e0e4e5c1850ebd85a8438cf96e15f7

Make progress bar behave nicely with stdout

Use options.clear to prevent it from running console.log
Let it take up the full screen width
Charles Lehner committed on 2/26/2016, 11:10:11 PM
Parent: ddc92710d0eeb04faeb812b67f81828abb16b67d

Files changed

index.jschanged
index.jsView
@@ -155,17 +155,19 @@
155155 return dummyProgress
156156 }
157157
158158 var numObjects
159- var size = 60 // process.stderr.columns - 5
160- var bar = new ProgressBar(':percent :bar', { total: size })
159+ var size = process.stderr.columns
160+ var bar = new ProgressBar(':percent :bar', {
161+ total: size,
162+ clear: true
163+ })
161164
162165 var progress = function (readObject) {
163166 return function (abort, cb) {
164167 readObject(abort, function next(end, object) {
165168 if (end === true) {
166- // seems to interfere with stdout
167- // bar.terminate()
169+ bar.terminate()
168170 } else if (!end) {
169171 var name = object.type + ' ' + object.length
170172 bar.tick(size / numObjects)
171173 }

Built with git-ssb-web