-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Description
//...
https.get(url, response => {
// if --progress run the progressbar
if (flags.progress) {
const len = parseInt(response.headers['content-length'], 10);
const bar = new ProgressBar(chalk `{yellow ↓} {red :percent} [:bar] :elapsed s`, {
complete: '=',
incomplete: ' ',
width: 20,
total: len,
clear: true
});
// on data received fill the progressbar
response.on('data', chunk => {
bar.tick(chunk.length, {
passphrase: 'Making something awesome'
});
});
}
//... rest of the functioncauses:
/Users/rawnly/code/NODE/splash-cli-2018/node_modules/progress/lib/node-progress.js:155
complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete);
^
RangeError: Invalid array length
at ProgressBar.render (/Users/rawnly/code/NODE/splash-cli-2018/node_modules/progress/lib/node-progress.js:155:14)
at ontimeout (timers.js:471:11)
at tryOnTimeout (timers.js:306:5)
at Timer.listOnTimeout (timers.js:266:5)Metadata
Metadata
Assignees
Labels
No labels