svgo
svgo copied to clipboard
Option to ignore not found error?
Would like a way to not throw an error when there are no SVG files found in a folder. In certain use cases, it is not considered an "error" just simply the folder is empty. This can break some processes which rely on this command. It can be hacked, but not very elegant.
For example when the public folder does not contain any SVG files:
svgo -q -r -f public
Error: No SVG files have been found in 'public' directory.
Echo this, not sure if there is an option?
Would also like to see this resolved. I have SVGO in my site boilerplate, and some projects either don't have SVGs to parse, or don't have them yet during development. Wish this was at most a warning, not an error.
I also need this functionality or at least a workaround. @shirotech can you share your approach?
I also need this functionality or at least a workaround. @shirotech can you share your approach?
Sure, here is my current workaround:
svgo -q -r -f public/icons &> /dev/null || :