From 8d23962e14a04887bfbd988da36568920907271c Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 29 Oct 2020 10:34:34 +0100 Subject: [PATCH] fixed downloadURLFromGit so it only return the first of multiple matching values --- Installomator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 8f81bb4..9d7a9a4 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -192,10 +192,10 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name if [ -n "$archiveName" ]; then downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \ - | awk -F '"' "/browser_download_url/ && /$archiveName/ { print \$4 }") + | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") else downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \ - | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4 }") + | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") fi if [ -z "$downloadURL" ]; then printlog "could not retrieve download URL for $gitusername/$gitreponame"