depot/third_party/nixpkgs/pkgs/data/fonts/nerdfonts/update.sh
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

21 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 '\t"%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"