linuxKernel.kernels.linux_zen: 6.11.5-zen1 -> v6.12.1-zen1; linuxKernel.kernels.linux...
[NixPkgs.git] / pkgs / by-name / wa / waveterm / update.sh
blob37eadc1edee66ef03f298afaf1a59ce7ddb5e2fd
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
4 set -eou pipefail
6 latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/wavetermdev/waveterm/releases/latest | jq -r ".tag_name")
7 latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
8 currentVersion=$(nix-instantiate --eval -E "with import ./. {}; waveterm.version" | tr -d '"')
10 echo "latest version: $latestVersion"
11 echo "current version: $currentVersion"
13 if [[ "$latestVersion" == "$currentVersion" ]]; then
14 echo "package is up-to-date"
15 exit 0
18 for i in \
19 "x86_64-linux waveterm-linux-x64" \
20 "aarch64-linux waveterm-linux-arm64"; do
21 set -- $i
22 prefetch=$(nix-prefetch-url --unpack "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/$2-$latestVersion.zip")
23 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
24 update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
25 done
27 for i in \
28 "x86_64-darwin Wave-darwin-x64" \
29 "aarch64-darwin Wave-darwin-arm64"; do
30 set -- $i
31 prefetch=$(nix-prefetch-url "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/$2-$latestVersion.zip")
32 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
33 update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
34 done