Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a preset overrides format option #37

Closed
AxelTerizaki opened this issue Aug 12, 2019 · 4 comments
Closed

Using a preset overrides format option #37

AxelTerizaki opened this issue Aug 12, 2019 · 4 comments
Labels
bug validated issue validated by maintainer

Comments

@AxelTerizaki
Copy link

Hello :)

I'm migrating from cliProgress 2.x to 3.0.0 and I'm having an issue.

Here's how I initialized my bar

this.format = `${options.message} [{bar}] {percentage}%`;
this.bar = new cliProgress.Bar({
  format: this.format,
  stopOnComplete: true
}, cliProgress.Presets.rect);

When I migrated to 3.0.0 I realized my format options was ignored :

 ■■■■■■■■■■■■■■■                         ■ 39% | ETA: 4s | 7472/19357

There was ETA and the value/total displayed.

I tried with other presets but it seems to cause the same issue.

At last I tried without any preset and there my format message was used :

Checking files...     [==================----------------------] 44%

So I think using a preset mistakenly overrides the format option.

Am I doing it wrong or is it a bug?

Thanks for the multi bar support, I'll need to think of how to use it properly but it's a neat feature :)

@AndiDittrich AndiDittrich added bug validated issue validated by maintainer labels Aug 12, 2019
@AndiDittrich
Copy link
Member

it's my fault... the options should take precedence over the preset

@AndiDittrich
Copy link
Member

fixed within master branch

@AxelTerizaki
Copy link
Author

Thanks for the quick fix ! I'll have to wait for 3.0.1 to be published on npm I guess :)

@AndiDittrich
Copy link
Member

the next release will be 3.1.0 including the notty mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug validated issue validated by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants