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"
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
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