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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user