update-icons.sh 557 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # Installs new icons to templates/_icons.
  3. # These icons should be committed to the git repository. Old icons are not
  4. # removed.
  5. set -e
  6. PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))
  7. PATH="$PROJECT_ROOT/node_modules/.bin:$PATH"
  8. TEMP=$(mktemp -d)
  9. OUT="$PROJECT_ROOT/templates/_icons"
  10. trap 'rm -rf "$TEMP"' EXIT
  11. fontello-cli install --config "$PROJECT_ROOT/fontello.json" --font "$TEMP" --css "$TEMP"
  12. font-blast "$TEMP/postmill.svg" "$TEMP"
  13. perl -pi -e's/^(<svg) ?/$1 width="16" height="16" /' "$TEMP/svg/"*.svg
  14. mv "$TEMP/svg/"*.svg "$OUT"