Merge pull request #57914 from bobvanderlinden/ngrok2-update-script

ngrok-2: use updateScript
This commit is contained in:
Robert Hensing 2019-03-19 21:35:22 +01:00 committed by GitHub
commit 9dd9769e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 16 deletions

View file

@ -32,6 +32,8 @@ stdenv.mkDerivation {
install -D ngrok $out/bin/ngrok
'';
passthru.updateScript = ./update.sh;
meta = {
description = "ngrok";
longDescription = ''

View file

@ -4,10 +4,8 @@
#!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' \
@ -16,25 +14,20 @@ get_download_info() {
channel=stable \
os=$1 \
goarm= \
arch=$2
# target_version=2.2.8 \
echo "}"
arch=$2 \
| jq --arg sys "$1-$2" '{
sys: $sys,
url: .download_url,
sha256: .checksum,
version: .release.version
}'
}
(
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
) | jq --slurp 'map ({ (.sys): . }) | add' \
> pkgs/tools/networking/ngrok-2/versions.json