nixpkgs/pkgs/by-name/lu/lunar-client/update.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
432 B
Bash
Raw Normal View History

2023-10-23 20:01:41 +00:00
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl yq
set -eu -o pipefail
target="$(dirname "$(readlink -f "$0")")/package.nix"
host="https://launcherupdates.lunarclientcdn.com"
metadata=$(curl "$host/latest-linux.yml")
version=$(echo "$metadata" | yq .version -r)
2023-12-12 20:28:08 +00:00
hash=$(echo "$metadata" | yq .sha512 -r)
2023-10-23 20:01:41 +00:00
sed -i "s@version = .*;@version = \"$version\";@g" "$target"
2023-12-12 20:28:08 +00:00
sed -i "s@hash.* = .*;@hash = \"sha512-$hash\";@g" "$target"