Skip to content

Instantly share code, notes, and snippets.

@firefoxic
Last active July 22, 2018 22:23
Show Gist options
  • Save firefoxic/493a05e967c383e5404878a3b183ed35 to your computer and use it in GitHub Desktop.
Save firefoxic/493a05e967c383e5404878a3b183ed35 to your computer and use it in GitHub Desktop.
Bash script that convert files in directory from ttf to woff2 format and delete ttf files (require npm package ttf2woff2).
#!/bin/zsh
for file in $(find ./**/*.ttf)
do
filename=${file%.*}
echo 👉 $filename.woff2 …
cat $file | ttf2woff2 >> $filename.woff2
rm $file
echo …is ready 👍
done
echo '🎉 Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment