Piped/localizefonts.sh

12 lines
312 B
Bash
Raw Normal View History

2022-12-17 13:47:30 +00:00
#!/bin/sh
base='https://fonts\.(gstatic\.com|kavin\.rocks)'
2023-09-14 05:43:19 +00:00
fonts=$(cat dist/assets/* | grep -Eo "${base}[^)]*" | sort | uniq)
for font in $fonts; do
file="dist/fonts$(echo "$font" | sed -E "s#$base##")"
mkdir -p "$(dirname "$file")"
curl -L "$font" -o "$file"
done
2022-12-13 00:15:44 +00:00
sed -Ei "s#$base#/fonts#g" dist/assets/*