mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-14 21:03:08 +00:00
fixed downloadURLFromGit so it only return the first of multiple matching values
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user