mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-11 06:34:13 +00:00
karabiner-elements: simplify updateScript
This commit is contained in:
parent
fa35b05955
commit
b941404ab9
@ -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}";
|
||||
|
@ -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}"
|
Loading…
Reference in New Issue
Block a user