karabiner-elements: simplify updateScript

This commit is contained in:
DontEatOreo 2024-08-19 01:42:21 +03:00
parent fa35b05955
commit b941404ab9
No known key found for this signature in database
GPG Key ID: 0DB5361BEEE530AB
2 changed files with 2 additions and 14 deletions

View File

@ -5,6 +5,7 @@
cpio,
xar,
undmg,
nix-update-script,
}:
stdenv.mkDerivation rec {
@ -54,7 +55,7 @@ stdenv.mkDerivation rec {
cp "$out/Library/Application Support/org.pqrs/Karabiner-Elements/package-version" "$out/Library/Application Support/org.pqrs/Karabiner-Elements/version"
'';
passthru.updateScript = ./updater.sh;
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/pqrs-org/Karabiner-Elements/releases/tag/v${version}";

View File

@ -1,13 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
set -eo pipefail
new_version="$(curl -s "https://api.github.com/repos/pqrs-org/Karabiner-Elements/releases/latest" | jq -r '.tag_name | ltrimstr("v")')"
old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
if [[ "$new_version" == "$old_version" ]]; then
echo "Already up to date!"
exit 0
fi
update-source-version karabiner-elements "${new_version}"