biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / sauce-connect / update.sh
blobd74cbe577b3c918c46f4e7fffb151ba0fecf32fe
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p common-updater-scripts curl jq
3 # API documentation: https://docs.saucelabs.com/dev/api/connect/
5 set -Eeuo pipefail
6 shopt -s lastpipe
7 die() {
8 echo -e "${BASH_SOURCE[0]}:${BASH_LINENO[0]}" ERROR: "$@" >&2
9 exit 1
11 # shellcheck disable=2154
12 trap 's=$?; die "$BASH_COMMAND"; exit $s' ERR
14 # Versions may not be updated simultaneously across all platforms, so need to figure out the latest
15 # version that includes both platforms. For example, currently the latest on Linux is 4.9.2 while
16 # Mac is 4.9.1.
17 response=$(curl -fsSL 'https://api.us-west-1.saucelabs.com/rest/v1/public/tunnels/info/versions?all=true')
18 all_versions=$(jq --exit-status --raw-output \
19 '.all_downloads | to_entries[] | select(.value | has("linux") and has("osx")) | .key' \
20 <<< "$response")
21 latest_version=$(sort --version-sort <<< "$all_versions" | tail -n 1)
22 for platform in x86_64-linux x86_64-darwin; do
23 update-source-version sauce-connect 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" \
24 --source-key="passthru.sources.$platform"
25 update-source-version sauce-connect "$latest_version" \
26 --source-key="passthru.sources.$platform"
27 done