Created
June 28, 2020 09:49
-
-
Save nilshartmann/8726e5abe04c8bf2cdde0db6872a2072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,32 +0,0 @@ | |
#! /bin/bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
URL="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap" | |
http -p b "${URL}">${DIR}/fonts.css | |
FONTS_DIR=${DIR}/../public/assets/fonts/ | |
for i in `cat ${DIR}/fonts.css | grep url | cut -d "(" -f 4 | cut -d ")" -f 1`; do | |
echo Font: $i | |
# Host abschneiden (https://fonts.gstatic.com/) | |
TARGET=`echo $i|cut -b27-` | |
TARGET_FILE=$FONTS_DIR$TARGET | |
TARGET_DIR=`dirname $TARGET_FILE` | |
echo TARGET_FILE: $TARGET_FILE | |
echo TARGET_DIR: $TARGET_DIR | |
mkdir -p $TARGET_DIR | |
curl $i -o $TARGET_FILE | |
done | |
sed 's/https:\/\/fonts.gstatic.com/\/assets\/fonts/' ${DIR}/fonts.css >$FONTS_DIR/google-fonts.css | |
rm -f fonts.css |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment