From aac9761d6a328f9a18fa5c2ee34267478a122a1e Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 13 Jun 2019 23:18:28 +0300 Subject: [PATCH] fix(update): Fix version detection in update (#177) Fixes our `awk` magic to "parse" JSON responses so it can work both with and without newlines in responses. PIP does not format its JSON output whereas GitHub does. --- build-git.sh | 2 +- update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-git.sh b/build-git.sh index 31ad29c..2d8f3be 100755 --- a/build-git.sh +++ b/build-git.sh @@ -7,7 +7,7 @@ usage () { } if [ "$#" = 0 ]; then - set -- "$(curl -sSL 'https://api.github.com/repos/getsentry/sentry/git/refs/heads/master' | awk -F '"' '$2 == "sha" { print $4 }')" + set -- "$(curl -sSL 'https://api.github.com/repos/getsentry/sentry/git/refs/heads/master' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')" echo "No sha specified, using refs/head/master ($1)" fi diff --git a/update.sh b/update.sh index ccafec4..7ab4ed0 100755 --- a/update.sh +++ b/update.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -current="$(curl -sSL 'https://pypi.python.org/pypi/sentry/json' | awk -F '"' '$2 == "version" { print $4 }')" +current="$(curl -sSL 'https://pypi.python.org/pypi/sentry/json' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "version" { print $4 }')" set -x sed -ri 's/^(ENV SENTRY_VERSION) .*/\1 '"$current"'/' 9.1/Dockerfile