From 35662d810ea0db3cbbf0e2230c6b824e3627a601 Mon Sep 17 00:00:00 2001 From: CPatchane Date: Mon, 21 Jan 2019 13:57:45 +0100 Subject: [PATCH] fix: :bug: Slice complete correctly for progress bar (by @ptbrowne) From unmerged PR https://github.com/visionmedia/node-progress/pull/180 --- packages/cozy-scripts/utils/progress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cozy-scripts/utils/progress.js b/packages/cozy-scripts/utils/progress.js index a7404f27e..10e560769 100644 --- a/packages/cozy-scripts/utils/progress.js +++ b/packages/cozy-scripts/utils/progress.js @@ -168,7 +168,8 @@ ProgressBar.prototype.render = function(tokens, force) { ) /* add head to the complete string */ - if (completeLength > 0) complete = complete.slice(0, -1) + this.chars.head + if (completeLength > 0) + complete = complete.slice(0, -this.chars.complete.length) + this.chars.head /* fill in the actual progress bar */ str = str.replace(':bar', complete + incomplete)