depot/third_party/nixpkgs/pkgs/by-name/no/noto-fonts-monochrome-emoji/update.sh
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

25 lines
910 B
Bash
Executable file

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p common-updater-scripts git nix-prefetch
tmpdir=$(mktemp -d)
git -C "$tmpdir" init --initial-branch main
git -C "$tmpdir" config core.sparseCheckout true
git -C "$tmpdir" remote add origin https://github.com/google/fonts.git
echo "ofl/notoemoji/*" > "$tmpdir/.git/info/sparse-checkout"
git -C "$tmpdir" fetch origin main
git -C "$tmpdir" checkout main
newrev=$(git -C "$tmpdir" rev-list -1 HEAD "ofl/notoemoji/*.ttf")
newver=$(grep 'archive:' "$tmpdir/ofl/notoemoji/upstream.yaml" | grep -oP '(?<=v)[0-9]+\.[0-9]+')
newhash=$(nix-prefetch "{ stdenv, fetchurl }: stdenv.mkDerivation rec {
name = \"noto-fonts-cjk-serif\";
src = fetchFromGitHub {
owner = \"google\";
repo = \"fonts\";
rev = \"$newrev\";
sparseCheckout = [ \"ofl/notoemoji\" ];
};
}")
update-source-version noto-fonts-monochrome-emoji "$newver" "$newhash" --rev="$newrev"