mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
Various update scripts used hacks like jq -e -r or tr -d '"' to strip quotes from strings, instead of simply adding the --raw flag to nix-instantiate.
21 lines
745 B
Bash
21 lines
745 B
Bash
#!/usr/bin/env nix-shell
|
|
#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
|
|
#shellcheck shell=bash
|
|
|
|
# Implementation lovingly referenced and adapted from cavalier package's update.sh
|
|
|
|
set -eu -o pipefail
|
|
|
|
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
|
https://api.github.com/repos/LavaGang/MelonLoader.Installer/releases/latest | jq -e -r .tag_name)
|
|
old_version=$(nix-instantiate --eval --raw -A melonloader-installer.version)
|
|
|
|
if [[ $version == "$old_version" ]]; then
|
|
echo "New version same as old version, nothing to do." >&2
|
|
exit 0
|
|
fi
|
|
|
|
update-source-version melonloader-installer "$version"
|
|
|
|
$(nix-build -A melonloader-installer.fetch-deps --no-out-link) "$(dirname -- "${BASH_SOURCE[0]}")/deps.json"
|