nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p nix curl jq common-updater-scripts
3
4set -eou pipefail
5
6latestVersion=$(curl -s https://api.github.com/repos/mongodb-js/compass/releases/latest | jq -r .tag_name | sed 's/^v//')
7
8if [[ "$latestVersion" == "$UPDATE_NIX_OLD_VERSION" ]]; then
9 echo "mongodb-compass is already up-to-date: $latestVersion"
10 exit 0
11fi
12
13update-source-version mongodb-compass "$latestVersion"
14
15systems=$(nix eval --json -f . mongodb-compass.meta.platforms | jq -r '.[]')
16for system in $systems; do
17 url=$(nix eval --raw -f . mongodb-compass.src.url --system "$system")
18 hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "$url"))
19 update-source-version mongodb-compass "$latestVersion" "$hash" --system=$system --ignore-same-version --ignore-same-hash
20done