librewolf: 132.0.1 -> 132.0.1-1 (#355483)
[NixPkgs.git] / pkgs / by-name / wa / waveterm / update.sh
blob468477fa48f7fb4f41ce9e1c01657561bad4ef51
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
4 latestTag=$(curl -s ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} https://api.github.com/repos/wavetermdev/waveterm/releases/latest | jq -r ".tag_name")
5 latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
6 currentVersion=$(nix-instantiate --eval -E "with import ./. {}; waveterm.version" | tr -d '"')
8 echo "latest version: $latestVersion"
9 echo "current version: $currentVersion"
11 if [[ "$latestVersion" == "$currentVersion" ]]; then
12 echo "package is up-to-date"
13 exit 0
15 for i in \
16 "x86_64-linux waveterm-linux-x64" \
17 "aarch64-linux waveterm-linux-arm64" \
18 "x86_64-darwin Wave-darwin-x64" \
19 "aarch64-darwin Wave-darwin-arm64"; do
20 set -- $i
21 prefetch=$(nix-prefetch-url --unpack "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/$2-$latestVersion.zip")
22 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
23 update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
24 done