You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
614 B

  1. #!/bin/bash
  2. #
  3. # Cleans up icon set from https://docs.microsoft.com/en-us/azure/architecture/icons/
  4. #
  5. # flatten folder structure
  6. find . -name "*.svg" | xargs -I file mv file .
  7. find . -type d -empty -delete
  8. rm *.pdf
  9. # weird files, one of which is broken
  10. rm 00474-Icon-Service-Elixir.svg
  11. mv '00474-Icon-Service-Elixir Purple.svg' Elixir-Purple.svg
  12. # remove stupid prefixes
  13. rename 's/\d+-icon-service-(.*)$/${1}/' *.svg
  14. # remove xlink which causes svgo to explode
  15. find . -type f -exec sed -i 's/xlink:href=".*"//g' {} \;
  16. # finally remove width & height from files and optimize
  17. svgo -f . --enable=removeDimensions