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

--config option does not handle raw JSON nor fail with incorrect values #1366

Closed
mtancoigne opened this issue Feb 22, 2021 · 4 comments
Closed

Comments

@mtancoigne
Copy link

Hi!

I'm working with the image_optim Ruby gem which relies on SVGo to optimize SVGs. I'm having trouble to see how we can switch from v1.3.x to v2, as the gem relies on --disable and --enable.

svgo --help states that --config allows to pass raw JSON string, but it seems to do nothing with raw JSON (svgo -i file.svg -o out.svg --config="{floatPrecision:1}" produces the same file as if no option was given).

In addition, when --config has "invalid" data, it's silently ignored.

Is it intentional ?

@TrySound
Copy link
Member

Hi!

Both disable/enable flags and config as json string support was removed in v2. I forgot to fix help command.
Fixed the help and error here. Will release tomorrow.
a855b40

@TrySound
Copy link
Member

Is it possible for you to use svg.config.js?

@mtancoigne
Copy link
Author

Thanks for your quick reply; I'll see if and how we can manage this :)

@TrySound
Copy link
Member

Fixed error when json string is specified instead of path https://github.com/svg/svgo/releases/tag/v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants