mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Change mathing on archiveName for GitHub.
This commit is contained in:
@@ -160,7 +160,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
||||
|
||||
if [ -n "$archiveName" ]; then
|
||||
#downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1)
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1)
|
||||
else
|
||||
#downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1)
|
||||
|
||||
@@ -56,11 +56,9 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
||||
#echo "$githubPart"
|
||||
#downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest"
|
||||
if [ -n "$archiveName" ]; then
|
||||
#downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1)
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1)
|
||||
else
|
||||
#downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1)
|
||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$type" | tail -1)
|
||||
fi
|
||||
echo "$downloadURL"
|
||||
return 0
|
||||
@@ -249,6 +247,9 @@ for fixedArch in i386 arm64; do
|
||||
fi
|
||||
else
|
||||
githubPart="$(echo "$downloadURL" | cut -d "/" -f4-6)"
|
||||
echo "type: $type"
|
||||
echo "archiveName: $archiveName"
|
||||
echo "githubPart: $githubPart"
|
||||
if [[ "$(curl -fsL "$downloadURL" | grep -io "${githubPart}.*\.${expectedExtension}")" != "" ]]; then
|
||||
echo "${GREEN}OK: download extension MATCH on ${expectedExtension}${NC}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user