Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
34 lines
1.3 KiB
Bash
Executable File
34 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p bash nix curl coreutils jq common-updater-scripts
|
|
|
|
set -eou pipefail
|
|
|
|
latestVersion=$(curl -Ls 'https://data.services.jetbrains.com/products?code=TBA&release.type=release' | jq -r '.[0].releases | flatten | .[0].build')
|
|
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; jetbrains-toolbox.version" | tr -d '"')
|
|
|
|
echo "latest version: $latestVersion"
|
|
echo "current version: $currentVersion"
|
|
|
|
if [[ "$latestVersion" == "$currentVersion" ]]; then
|
|
echo "package is up-to-date"
|
|
exit 0
|
|
fi
|
|
|
|
update-source-version jetbrains-toolbox $latestVersion
|
|
|
|
systems=$(nix-instantiate --eval --json -E 'with import ./. {}; jetbrains-toolbox.meta.platforms' | jq -r '.[]')
|
|
|
|
for system in $systems; do
|
|
arch="${system%%:*}"
|
|
suffix="${system#*:}"
|
|
url=$(nix-instantiate --eval --json -E "with import ./. { system = \"$system\"; }; jetbrains-toolbox.src.url" | jq -r)
|
|
if [[ $url == *.tar.gz ]]; then
|
|
unpack="--unpack"
|
|
else
|
|
unpack=""
|
|
fi
|
|
prefetch=$(nix-prefetch-url $unpack "$url")
|
|
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
|
|
update-source-version jetbrains-toolbox $latestVersion $hash --system=$system --ignore-same-version
|
|
done
|