mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
sunshine: fix updater script
The script broke when invoked from the package directory: nix-update
looked for a default.nix in the cwd. Move to the nixpkgs root before
calling it.
`--generate-lockfile` and the npmDepsHash refresh are mutually exclusive
in a single nix-update pass, so the ui subpackage hash was never
updated.
Split the ui update into two passes.
Also restore the early-exit when UPDATE_NIX_OLD_VERSION matches, quote
$version, and add the shellcheck shell directive.
Assisted-by: Claude Code 4.7
(cherry picked from commit 0085f4f7a8)
This commit is contained in:
parent
1a25c6ac50
commit
4c14f3f2ab
1 changed files with 9 additions and 2 deletions
|
|
@ -1,13 +1,20 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p gnugrep curl jq nix-update
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../../../.."
|
||||
|
||||
version=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --silent --location https://api.github.com/repos/LizardByte/Sunshine/releases/latest | jq --raw-output .tag_name | grep -oP "^v\K.*")
|
||||
|
||||
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
|
||||
if [[ "${UPDATE_NIX_OLD_VERSION:-}" == "$version" ]]; then
|
||||
echo "Already up to date!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
nix-update sunshine --version $version --generate-lockfile --subpackage ui
|
||||
nix-update sunshine --version "$version"
|
||||
# `--generate-lockfile` only regenerates package-lock.json; it skips the npmDepsHash
|
||||
# refresh (see nix-update's dependency_hashes.py). Run a second pass to update the hash.
|
||||
nix-update sunshine --version=skip --generate-lockfile --subpackage ui
|
||||
nix-update sunshine --version=skip --subpackage ui
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue