mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
14 lines
468 B
Bash
Executable File
14 lines
468 B
Bash
Executable File
#!/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}"
|