ngrok2: cleanup update.sh

This commit is contained in:
Bob van der Linden 2019-03-19 20:05:51 +01:00
parent b1bfe7b478
commit d394fa0d96
No known key found for this signature in database
GPG Key ID: 2A90361F99CF1795

View File

@ -4,10 +4,8 @@
#!nix-shell -i bash #!nix-shell -i bash
set -eu -o pipefail set -eu -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
get_download_info() { get_download_info() {
echo '{ "sys": "'"$1-$2"'", "response": '
http --body \ http --body \
https://update.equinox.io/check \ https://update.equinox.io/check \
'Accept:application/json; q=1; version=1; charset=utf-8' \ 'Accept:application/json; q=1; version=1; charset=utf-8' \
@ -16,25 +14,20 @@ get_download_info() {
channel=stable \ channel=stable \
os=$1 \ os=$1 \
goarm= \ goarm= \
arch=$2 arch=$2 \
| jq --arg sys "$1-$2" '{
# target_version=2.2.8 \ sys: $sys,
url: .download_url,
echo "}" sha256: .checksum,
version: .release.version
}'
} }
( (
echo "["
get_download_info linux 386 get_download_info linux 386
echo ","
get_download_info linux amd64 get_download_info linux amd64
echo ","
get_download_info linux arm get_download_info linux arm
echo ","
get_download_info linux arm64 get_download_info linux arm64
# echo ","
# get_download_info darwin 386
echo ","
get_download_info darwin amd64 get_download_info darwin amd64
echo "]" ) | jq --slurp 'map ({ (.sys): . }) | add' \
) | jq 'map ({ (.sys): { "sys": .sys, "url": .response.download_url, "sha256": .response.checksum, "version": .response.release.version } }) | add' >versions.json > pkgs/tools/networking/ngrok-2/versions.json