chore: add back inline docs for gfonts download
This commit is contained in:
parent
3883f66588
commit
6ec531eeab
1 changed files with 6 additions and 3 deletions
|
|
@ -12,9 +12,12 @@ for FONT in "${FONTS[@]}"; do
|
|||
FONT="${FONT%"${FONT##*[![:space:]]}"}" # Trim trailing whitespace
|
||||
mkdir -p "${DEST}/${FONT}"
|
||||
|
||||
readarray -t "FILE_REFS" < <(
|
||||
if output=$(curl -s "https://fonts.google.com/download/list?family=${FONT// /%20}" | tail -n +2); then
|
||||
if FILE_REFS=$(echo "$output" | jq -c '.manifest.fileRefs[]' 2>/dev/null); then
|
||||
readarray -t FILE_REFS < <(
|
||||
if JSON=$(
|
||||
curl -s "https://fonts.google.com/download/list?family=${FONT// /%20}" | # spaces are replaced with %20 for the URL
|
||||
tail -n +2 # remove first line, which as of March 2024 contains ")]}'" and breaks JSON parsing
|
||||
); then
|
||||
if FILE_REFS=$(echo "$JSON" | jq -c '.manifest.fileRefs[]' 2>/dev/null); then
|
||||
echo "$FILE_REFS"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue