nexusmods-app.updateScript: check if package was updated

Before updating `games.json` and the game hashes DB, check if the main
package version was actually changed.
This commit is contained in:
Matt Sturgeon
2025-12-21 18:45:23 +00:00
parent eac9df23c4
commit 6feb386f20
+19 -6
View File
@@ -10,15 +10,28 @@ self=$(realpath "$0")
dir=$(dirname "$self")
cd "$dir"/../../../../
# Update vendored files
"$dir"/vendored/update.sh
# Update game_hashes_db
UPDATE_NIX_ATTR_PATH="$UPDATE_NIX_ATTR_PATH.gameHashes" \
"$dir"/game-hashes/update.sh
current_version=$(
nix-instantiate --eval --raw \
--attr "$UPDATE_NIX_ATTR_PATH.version"
)
url=$(
nix-instantiate --eval --raw \
--attr "$UPDATE_NIX_ATTR_PATH.meta.homepage"
)
nix-update --url "$url"
new_version=$(
nix-instantiate --eval --raw \
--attr "$UPDATE_NIX_ATTR_PATH.version"
)
if [ "$current_version" != "$new_version" ]; then
# Update vendored files
"$dir"/vendored/update.sh
# Update game_hashes_db
UPDATE_NIX_ATTR_PATH="$UPDATE_NIX_ATTR_PATH.gameHashes" \
"$dir"/game-hashes/update.sh
fi