1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 22:50:49 +00:00
nixpkgs/pkgs/data/fonts/nerdfonts/update.sh
2021-01-20 14:52:16 +10:00

22 lines
606 B
Bash
Executable file

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nix-prefetch jq
latest_release=$(curl --silent https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest)
version=$(jq -r '.tag_name' <<<"$latest_release")
dirname="$(dirname "$0")"
echo \""${version#v}"\" >"$dirname/version.nix"
echo Using version "$version"
printf '{\n' > "$dirname/shas.nix"
while
read -r name
read -r url
do
printf ' "%s" = "%s";\n' "${name%.*}" "$(nix-prefetch-url "$url")" >>"$dirname/shas.nix"
done < <(jq -r '.assets[] | .name, .browser_download_url' <<<"$latest_release")
printf '}\n' >> "$dirname/shas.nix"