1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
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"
19 "x86_64-linux waveterm-linux-x64" \
20 "aarch64-linux waveterm-linux-arm64"; do
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
28 "x86_64-darwin Wave-darwin-x64" \
29 "aarch64-darwin Wave-darwin-arm64"; do
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