Simple-minded command line program to shorten an octicon sprite file by keeping only the sprites you want (by id).
node octiclean path-to-sprite.octicons.svg id1 id2 ...
or a single comma delimited final argument
node octiclean path-to-sprite.octicons.svg id1,id2 ...
e.g., to use sprite.octicons.svg in current directory, and keep only bell and chevron-up,
node octiclean . bell chevron-up
to keep bell and chevron-up from subdir/myspritefile.svg
node octiclean subdir/myspritefile.svg bell chevron-up
- Logic isn't all that sharp, use with caution
- If you misspell an id, tough luck - verify your result file!
- Adds sprite.octicons.svg to the path if it doesn't already end with ".svg"
- I've done minimal testing, please let me know when you find bugs.