Skip to content

Commit

Permalink
[progress-bar/upload-docs] fix jshint violations
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Nov 1, 2017
1 parent 4fca5bc commit 031a6c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/fn/upload-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const log = require('../lib/log');
const pouch = require('../lib/db');
const progressBar = require('../lib/progress-bar');
const skipFn = require('../lib/skip-fn');
const trace = require('../lib/log').trace;
const warn = require('../lib/log').warn;

const BATCH_SIZE = 10;
Expand Down
9 changes: 4 additions & 5 deletions src/lib/progress-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ module.exports = {
const percent = Math.floor(runningTotal * 100 / target);
let bar = '', i;

const formattedMessage = message.replace('{{N}}', runningTotal).replace('{{M}}', target);
const formattedMessage = message.replace('{{N}}', runningTotal).replace('{{M}}', target);

const barTotal = process.stdout.columns - formattedMessage.length - 9;
const pBarLen = i = Math.floor(runningTotal * barTotal / target);
const pBarLen = Math.floor(runningTotal * barTotal / target);

while(--i >= 0) bar += '█';
for(i=pBarLen; i>0; --i) bar += '█';

i = barTotal - pBarLen;
while(--i >= 0) bar += ' ';
for(i=barTotal-pBarLen; i>0; --i) bar += ' ';

process.stdout.write(`\r${formattedMessage}[${bar}] (${percent}%)`);
},
Expand Down

0 comments on commit 031a6c0

Please sign in to comment.