nixpkgs/pkgs/data/fonts/league-of-moveable-type/update.sh
Profpatsch fc19902260 league-of-movable-type: 2014-12 -> 2016-10-15
Restructured, so that updates can be done by executing a shell script.
Also uses the extended Raleway fonts, the league itself has only thin
variants.
2016-10-15 06:49:50 +02:00

26 lines
585 B
Bash

#!/usr/bin/env bash
SITE=https://www.theleagueofmoveabletype.com
# since there is no nice way to get all the fonts,
# this fetches the homepage and extracts their names from the html …
fonts=$(curl "$SITE" 2>/dev/null | \
sed -ne 's/<img.*cloudfront.*images\/\(.*\)-[[:digit:]-]\..*$/\1/p')
# build an ad-hoc nixexpr list with the files & hashes
echo "["
for f in $fonts; do
url="$SITE/$f/download"
hash=$(nix-prefetch-url --type sha256 "$url" 2>/dev/null)
cat <<EOF
{
url = "$url";
sha256 = "$hash";
name = "$f.zip";
}
EOF
done
echo "]"