depot/third_party/nixpkgs/pkgs/data/fonts/iosevka/update-comfy.sh
Default email c6ca5b8f13 Project import generated by Copybara.
GitOrigin-RevId: e4d49de45a3b5dbcb881656b4e3986e666141ea9
2022-07-18 18:21:45 +02:00

33 lines
1.1 KiB
Bash
Executable file

#! /usr/bin/env nix-shell
#! nix-shell -i bash -p curl jq
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
repo=protesilaos/iosevka-comfy
oldVersion=$(nix-instantiate --eval -E 'with import ../../../.. {}; lib.getVersion iosevka-comfy.comfy' | tr -d \")
version=$(curl -s https://api.github.com/repos/$repo/tags | jq '.[0].name' | tr -d \")
buildPlansUrl=https://raw.githubusercontent.com/$repo/$(echo $version)/private-build-plans.toml
if test "$oldVersion" = "$version"; then
echo "New version same as old version, nothing to do." >&2
exit 0
fi
sed --in-place "s/$oldVersion/$version/" comfy.nix
cat > ./comfy-private-build-plans.toml <<EOF
# The file below is copy/pasted from
# $buildPlansUrl. It
# seems like ofborg will prevent me from using fetchurl to download
# this file automatically.
EOF
wget --quiet --output-document=- "$buildPlansUrl" >> ./comfy-private-build-plans.toml
sets=$(grep '^\[buildPlans\.iosevka-comfy[^.]*\]' comfy-private-build-plans.toml \
| sed 's/^.*iosevka-\(comfy[^]]*\)].*$/"\1" /' \
| tr -d '\n' \
| sort)
sed --in-place "s/sets = .*$/sets = [ $sets];/" comfy.nix