mirror of
https://github.com/mtan93/Installomator.git
synced 2026-05-12 14:26:07 +01: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
|
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=$(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
|
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=$(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.*\.$filetype" | tail -1)
|
||||||
|
|||||||
@@ -56,11 +56,9 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
|||||||
#echo "$githubPart"
|
#echo "$githubPart"
|
||||||
#downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest"
|
#downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest"
|
||||||
if [ -n "$archiveName" ]; then
|
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
|
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.*\.$type" | tail -1)
|
||||||
downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1)
|
|
||||||
fi
|
fi
|
||||||
echo "$downloadURL"
|
echo "$downloadURL"
|
||||||
return 0
|
return 0
|
||||||
@@ -249,6 +247,9 @@ for fixedArch in i386 arm64; do
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
githubPart="$(echo "$downloadURL" | cut -d "/" -f4-6)"
|
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
|
if [[ "$(curl -fsL "$downloadURL" | grep -io "${githubPart}.*\.${expectedExtension}")" != "" ]]; then
|
||||||
echo "${GREEN}OK: download extension MATCH on ${expectedExtension}${NC}"
|
echo "${GREEN}OK: download extension MATCH on ${expectedExtension}${NC}"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user