biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / misc / archi / update.sh
blobd405a188d3d09720fc23a1ff00300ca63d012052
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq coreutils common-updater-scripts
4 latestVersion=$(curl "https://api.github.com/repos/archimatetool/archi/tags" | jq -r '.[0].name' | tail -c +9)
5 currentVersion=$(nix-instantiate --eval -E "with import ./. {}; archi.version or (lib.getVersion archi)" | tr -d '"')
7 echo "latest version: $latestVersion"
8 echo "current version: $currentVersion"
10 if [[ "$latestVersion" == "$currentVersion" ]]; then
11 echo "package is up-to-date"
12 exit 0
15 for i in \
16 "aarch64-darwin Archi-Mac-Silicon-$latestVersion.dmg" \
17 "x86_64-darwin Archi-Mac-$latestVersion.dmg" \
18 "x86_64-linux Archi-Linux64-$latestVersion.tgz"
20 set -- $i
21 prefetch=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/$2)
22 hash=$(nix-hash --type sha256 --to-sri $prefetch)
24 update-source-version archi $latestVersion $hash --system=$1 --ignore-same-version
25 done