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