1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-16 18:03:22 +00:00
nixpkgs/pkgs/tools/networking/ngrok-2/update.sh

41 lines
1,020 B
Bash
Raw Normal View History

2019-03-12 17:19:10 +00:00
#!/usr/bin/env nix-shell
#!nix-shell -p httpie
#!nix-shell -p jq
#!nix-shell -i bash
set -eu -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
get_download_info() {
echo '{ "sys": "'"$1-$2"'", "response": '
http --body \
https://update.equinox.io/check \
'Accept:application/json; q=1; version=1; charset=utf-8' \
'Content-Type:application/json; charset=utf-8' \
app_id=app_goVRodbMVm \
channel=stable \
os=$1 \
goarm= \
arch=$2
2019-03-12 19:29:35 +00:00
# target_version=2.2.8 \
2019-03-12 17:19:10 +00:00
echo "}"
}
(
echo "["
get_download_info linux 386
echo ","
get_download_info linux amd64
echo ","
get_download_info linux arm
echo ","
get_download_info linux arm64
# echo ","
# get_download_info darwin 386
echo ","
get_download_info darwin amd64
echo "]"
) | jq 'map ({ (.sys): { "sys": .sys, "url": .response.download_url, "sha256": .response.checksum, "version": .response.release.version } }) | add' >versions.json