mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-29 14:23:06 +01:00
GitHub improvements
I'm really proud to figure this out. Take a look at hos this label is being build: ``` % Documents/GitHub/Installomator/utils/buildLabel.sh "https://github.com/Aleph-One-Marathon/alephone/releases/download/release-20210408/Marathon-20210408-Mac.dmg" Changing directory to /Users/st/Downloads/2021-11-13-20-03-26 Working dir: /Users/st/Downloads/2021-11-13-20-03-26 Downloading https://github.com/Aleph-One-Marathon/alephone/releases/download/release-20210408/Marathon-20210408-Mac.dmg Marathon-20210408-Mac.dmg Redirecting to (maybe this can help us with version): % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 662 100 662 0 0 2225 0 --:--:-- --:--:-- --:--:-- 2290 100 49.7M 100 49.7M 0 0 7284k 0 0:00:06 0:00:06 --:--:-- 10.5M archiveTempName: Marathon-20210408-Mac.dmg archivePath: https://objects.githubusercontent.com/github-production-release-asset-2e65be/39701264/c534b380-98b5-11eb-9c5b-bd8909ee1263?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211113%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211113T190327Z&X-Amz-Expires=300&X-Amz-Signature=bb6789b784ade0fd9b1f81ca88d63dd09224bae9fd15be4a4a61f31425aca553&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=39701264&response-content-disposition=attachment%3B%20filename%3DMarathon-20210408-Mac.dmg&response-content-type=application%2Foctet-stream Calculated archiveName: Marathon-20210408-Mac.dmg name: Marathon-20210408-Mac archiveExt: dmg identifier: marathon20210408mac Diskimage found Mounting Marathon-20210408-Mac.dmg Mounted: /Volumes/Marathon Verifying: /Volumes/Marathon/Marathon.app "disk8" ejected. https://github.com/Aleph-One-Marathon/alephone/releases/download/release-20210408/Marathon-20210408-Mac.dmg ********** Found GitHub path Github place: Aleph-One-Marathon alephone Latest URL on github: https://github.com/Aleph-One-Marathon/alephone/releases/download/release-20210408/AlephOne-20210408-Mac.dmg Latest version: 20210408 Calculated GitHub URL almost identical, only this diff: “release-20210408/Marathon-20210408-Mac.dmg” and “release-20210408/AlephOne-20210408-Mac.dmg” Could be version difference or difference in archiveName for a given release. Testing for version difference. Not a version problem. Testing for difference in archiveName. archiveName="Marathon-[0-9.]*-Mac.dmg" Latest URL on github: https://github.com/Aleph-One-Marathon/alephone/releases/download/release-20210408/Marathon-20210408-Mac.dmg Latest version: 20210408 GitHub calculated URL matches entered URL. ********** Labels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed. marathon20210408mac) name="Marathon" type="dmg" archiveName="Marathon-[0-9.]*-Mac.dmg" downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" expectedTeamID="E8K89CXZE7" ;; Label converted to GitHub label without errors. Details can be seen above. Above should be saved in a file with exact same name as label, and given extension “.sh”. Put this file in folder “fragments/labels”. ``` This repo on GitHub has several software titles, and because we have the link, it can automatically figure out how to make the `archiveName`.
This commit is contained in:
@@ -201,6 +201,7 @@ if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
|||||||
githubAuthor=$(echo "$downloadURL" | cut -d "/" -f4)
|
githubAuthor=$(echo "$downloadURL" | cut -d "/" -f4)
|
||||||
githubRepo=$(echo "$downloadURL" | cut -d "/" -f5)
|
githubRepo=$(echo "$downloadURL" | cut -d "/" -f5)
|
||||||
if [[ ! -z $githubAuthor && $githubRepo ]] ; then
|
if [[ ! -z $githubAuthor && $githubRepo ]] ; then
|
||||||
|
githubError=9
|
||||||
echo "Github place: $githubAuthor $githubRepo"
|
echo "Github place: $githubAuthor $githubRepo"
|
||||||
originalDownloadURL="$downloadURL"
|
originalDownloadURL="$downloadURL"
|
||||||
githubDownloadURL=$(downloadURLFromGit "$githubAuthor" "$githubRepo")
|
githubDownloadURL=$(downloadURLFromGit "$githubAuthor" "$githubRepo")
|
||||||
@@ -209,6 +210,7 @@ if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
|||||||
echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion"
|
echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion"
|
||||||
if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then
|
if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then
|
||||||
echo "GitHub calculated URL matches entered URL."
|
echo "GitHub calculated URL matches entered URL."
|
||||||
|
githubError=0
|
||||||
downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)"
|
downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)"
|
||||||
appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)"
|
appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)"
|
||||||
else
|
else
|
||||||
@@ -221,6 +223,7 @@ if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
|||||||
if [[ "$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" == "$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" ]]; then
|
if [[ "$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" == "$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" ]]; then
|
||||||
echo "“$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')” and “$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')”"
|
echo "“$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')” and “$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')”"
|
||||||
echo "Matching without numbers in string.\nVERY LIKELY a version difference."
|
echo "Matching without numbers in string.\nVERY LIKELY a version difference."
|
||||||
|
githubError=1
|
||||||
echo "Try running again with URL: ${githubDownloadURL}"
|
echo "Try running again with URL: ${githubDownloadURL}"
|
||||||
else
|
else
|
||||||
echo "Not a version problem.\nTesting for difference in archiveName."
|
echo "Not a version problem.\nTesting for difference in archiveName."
|
||||||
@@ -233,9 +236,11 @@ if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
|||||||
echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion"
|
echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion"
|
||||||
if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then
|
if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then
|
||||||
echo "GitHub calculated URL matches entered URL."
|
echo "GitHub calculated URL matches entered URL."
|
||||||
|
githubError=0
|
||||||
downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)"
|
downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)"
|
||||||
appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)"
|
appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)"
|
||||||
else
|
else
|
||||||
|
githubError=2
|
||||||
echo "Not solved by using archiveName."
|
echo "Not solved by using archiveName."
|
||||||
echo "Not sure what this can be."
|
echo "Not sure what this can be."
|
||||||
archiveDestinationName=""
|
archiveDestinationName=""
|
||||||
@@ -250,14 +255,14 @@ if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo "\n**********"
|
||||||
echo "**********"
|
echo "\nLabels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed."
|
||||||
echo
|
|
||||||
echo "Labels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed."
|
if [[ -z $githubError || $githubError != 0 ]]; then
|
||||||
echo
|
echo "\nappNewVersion is often difficult to find. Can sometimes be found in the filename, sometimes as part of the download redirects, but also on a web page. See redirect and archivePath above if link contains information about this. That is a good place to start"
|
||||||
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, sometimes as part of the download redirects, but also on a web page. See redirect and archivePath above if link contains information about this. That is a good place to start"
|
fi
|
||||||
echo
|
|
||||||
echo "$identifier)"
|
echo "\n$identifier)"
|
||||||
echo " name=\"$name\""
|
echo " name=\"$name\""
|
||||||
echo " type=\"$archiveExt\""
|
echo " type=\"$archiveExt\""
|
||||||
if [ -n "$packageID" ]; then
|
if [ -n "$packageID" ]; then
|
||||||
@@ -273,7 +278,24 @@ if [ -n "$appName" ] && [ "$appName" != "${name}.app" ]; then
|
|||||||
echo " appName=\"$appName\""
|
echo " appName=\"$appName\""
|
||||||
fi
|
fi
|
||||||
echo " ;;"
|
echo " ;;"
|
||||||
echo
|
|
||||||
echo "Above should be saved in a file with exact same name as label, and given extension “.sh”."
|
case $githubError in
|
||||||
echo "Put this file in folder “fragments/labels”."
|
0)
|
||||||
echo
|
echo "\nLabel converted to GitHub label without errors."
|
||||||
|
echo "Details can be seen above."
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
echo "\nFound Github place in this URL: $githubAuthor $githubRepo"
|
||||||
|
echo "But version has a problem."
|
||||||
|
echo "Try running again with URL: ${githubDownloadURL}"
|
||||||
|
echo "See details above."
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo "\nFound Github place in this URL: $githubAuthor $githubRepo"
|
||||||
|
echo "But it could not be resolved."
|
||||||
|
echo "Can be from a hidden repository."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "\nAbove should be saved in a file with exact same name as label, and given extension “.sh”."
|
||||||
|
echo "Put this file in folder “fragments/labels”.\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user