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"
16 "aarch64-darwin Archi-Mac-Silicon-$latestVersion.dmg" \
17 "x86_64-darwin Archi-Mac-$latestVersion.dmg" \
18 "x86_64-linux Archi-Linux64-$latestVersion.tgz"
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