yabai: make updateScript work with nix-update --use-update-script

This commit is contained in:
Austin Horstman
2025-03-22 10:17:06 -05:00
parent 0d8254fedf
commit be4dd4cb0c
+2 -14
View File
@@ -77,21 +77,9 @@ stdenv.mkDerivation (finalAttrs: {
};
updateScript = writeShellScript "update-yabai" ''
set -o errexit
export PATH="${
lib.makeBinPath [
curl
jq
common-updater-scripts
]
}"
NEW_VERSION=$(curl --silent https://api.github.com/repos/koekeishiya/yabai/releases/latest | jq '.tag_name | ltrimstr("v")' --raw-output)
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
echo "The new version same as the old version."
exit 0
fi
NEW_VERSION=$(${lib.getExe curl} --silent https://api.github.com/repos/koekeishiya/yabai/releases/latest | ${lib.getExe jq} '.tag_name | ltrimstr("v")' --raw-output)
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
update-source-version "yabai" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
${lib.getExe' common-updater-scripts "update-source-version"} "yabai" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
done
'';
};