From c15a355da75570b74ad3b93ba70a7c38702169af Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Fri, 17 Aug 2018 13:09:24 -0700 Subject: [PATCH] strip out all extra lines other than the first for parsing --- scripts/get | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get b/scripts/get index 79dd69500..29cd47e1a 100755 --- a/scripts/get +++ b/scripts/get @@ -78,9 +78,9 @@ checkDesiredVersion() { # Use the GitHub releases webpage for the project to find the desired version for this project. local release_url="https://github.com/helm/helm/releases/${DESIRED_VERSION:-latest}" if type "curl" > /dev/null; then - TAG=$(curl -SsL $release_url | awk '/\/tag\//' | grep -v no-underline | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') + TAG=$(curl -SsL $release_url | awk '/\/tag\//' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') elif type "wget" > /dev/null; then - TAG=$(wget -q -O - $release_url | awk '/\/tag\//' | grep -v no-underline | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') + TAG=$(wget -q -O - $release_url | awk '/\/tag\//' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') fi if [ "x$TAG" == "x" ]; then echo "Cannot determine ${DESIRED_VERSION} tag."