Merge pull request #219124 from doronbehar/pkg/nerdfonts

nerdfonts: add update.sh script to passthru
This commit is contained in:
Doron Behar 2023-03-05 07:47:35 +02:00 committed by GitHub
commit 9fc7d2ca0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -59,6 +59,7 @@ stdenv.mkDerivation rec {
rm -rfv $out/share/fonts/truetype/NerdFonts/*Windows\ Compatible.*
''}
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts";

View File

@ -5,9 +5,14 @@ latest_release=$(curl --silent https://api.github.com/repos/ryanoasis/nerd-fonts
version=$(jq -r '.tag_name' <<<"$latest_release")
dirname="$(dirname "$0")"
echo \""${version#v}"\" >"$dirname/version.nix"
echo Using version "$version"
echo \""${version#v}"\" >"$dirname/version-new.nix"
if diff -q "$dirname/version-new.nix" "$dirname/version.nix"; then
echo No new version available, current: $version
exit 0
else
echo Updated to version "$version"
mv "$dirname/version-new.nix" "$dirname/version.nix"
fi
printf '{\n' > "$dirname/shas.nix"