mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-31 14:23:26 +01: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
|
if [ -n "$archiveName" ]; then
|
||||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
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
|
else
|
||||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
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
|
fi
|
||||||
if [ -z "$downloadURL" ]; then
|
if [ -z "$downloadURL" ]; then
|
||||||
printlog "could not retrieve download URL for $gitusername/$gitreponame"
|
printlog "could not retrieve download URL for $gitusername/$gitreponame"
|
||||||
|
|||||||
Reference in New Issue
Block a user