iosevka: add update script
As outlined in the previous commit, we just need to update the source URL in node-packages.json, and wait for node-packages.nix to be rebuilt from it.
This commit is contained in:
parent
e6bc641ef4
commit
26ce7f2607
2 changed files with 25 additions and 0 deletions
|
@ -89,6 +89,10 @@ stdenv.mkDerivation rec {
|
|||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
updateScript = ./update-default.sh;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://be5invis.github.io/Iosevka";
|
||||
downloadPage = "https://github.com/be5invis/Iosevka/releases";
|
||||
|
|
21
pkgs/data/fonts/iosevka/update-default.sh
Executable file
21
pkgs/data/fonts/iosevka/update-default.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p common-updater-scripts coreutils gawk replace
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
nixpkgs=../../../..
|
||||
repo=https://github.com/be5invis/Iosevka
|
||||
|
||||
# Discover the latest version.
|
||||
current_version=$(nix-instantiate "$nixpkgs" --eval --strict -A iosevka.version | tr -d '"')
|
||||
new_version=$(list-git-tags "$repo" | sort --reverse --version-sort | awk 'match($0, /^v([0-9.]+)$/, m) { print m[1]; exit; }')
|
||||
if [[ "$new_version" == "$current_version" ]]; then
|
||||
echo "iosevka: no update found"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Update the source package in nodePackages.
|
||||
current_source="$repo/archive/v$current_version.tar.gz"
|
||||
new_source="$repo/archive/v$new_version.tar.gz"
|
||||
replace-literal -ef "$current_source" "$new_source" ../../../development/node-packages/node-packages.json
|
||||
echo "iosevka: $current_version -> $new_version (after nodePackages update)"
|
Loading…
Reference in a new issue