mirror of
https://github.com/mtan93/Installomator.git
synced 2026-04-02 14:23:08 +01:00
Merge branch 'pr/659'
This commit is contained in:
@@ -160,10 +160,10 @@ 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.*")
|
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -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")
|
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)
|
||||||
fi
|
fi
|
||||||
if [ -z "$downloadURL" ]; then
|
if [ -z "$downloadURL" ]; then
|
||||||
cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
|
cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
|
||||||
|
|||||||
7
fragments/labels/cocoapods.sh
Normal file
7
fragments/labels/cocoapods.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
cocoapods)
|
||||||
|
name="CocoaPods"
|
||||||
|
type="bz2"
|
||||||
|
downloadURL="$(downloadURLFromGit CocoaPods CocoaPods-app)"
|
||||||
|
appNewVersion="$(versionFromGit CocoaPods CocoaPods-app)"
|
||||||
|
expectedTeamID="AX2Q2BH2XR"
|
||||||
|
;;
|
||||||
@@ -15,6 +15,29 @@ fi
|
|||||||
|
|
||||||
# MARK: application download and installation starts here
|
# MARK: application download and installation starts here
|
||||||
|
|
||||||
|
# Debug output of all variables in a label
|
||||||
|
printlog "name=${name}" DEBUG
|
||||||
|
printlog "appName=${appName}" DEBUG
|
||||||
|
printlog "type=${type}" DEBUG
|
||||||
|
printlog "archiveName=${archiveName}" DEBUG
|
||||||
|
printlog "downloadURL=${downloadURL}" DEBUG
|
||||||
|
printlog "curlOptions=${curlOptions}" DEBUG
|
||||||
|
printlog "appNewVersion=${appNewVersion}" DEBUG
|
||||||
|
printlog "appCustomVersion function: $(if type 'appCustomVersion' 2>/dev/null | grep -q 'function'; then echo "Defined. ${appCustomVersion}"; else; echo "Not defined"; fi)" DEBUG
|
||||||
|
printlog "versionKey=${versionKey}" DEBUG
|
||||||
|
printlog "packageID=${packageID}" DEBUG
|
||||||
|
printlog "pkgName=${pkgName}" DEBUG
|
||||||
|
printlog "choiceChangesXML=${choiceChangesXML}" DEBUG
|
||||||
|
printlog "expectedTeamID=${expectedTeamID}" DEBUG
|
||||||
|
printlog "blockingProcesses=${blockingProcesses}" DEBUG
|
||||||
|
printlog "installerTool=${installerTool}" DEBUG
|
||||||
|
printlog "CLIInstaller=${CLIInstaller}" DEBUG
|
||||||
|
printlog "CLIArguments=${CLIArguments}" DEBUG
|
||||||
|
printlog "updateTool=${updateTool}" DEBUG
|
||||||
|
printlog "updateToolArguments=${updateToolArguments}" DEBUG
|
||||||
|
printlog "updateToolRunAsCurrentUser=${updateToolRunAsCurrentUser}" DEBUG
|
||||||
|
#printlog "Company=${Company}" DEBUG # Not used
|
||||||
|
|
||||||
if [[ ${INTERRUPT_DND} = "no" ]]; then
|
if [[ ${INTERRUPT_DND} = "no" ]]; then
|
||||||
# Check if a fullscreen app is active
|
# Check if a fullscreen app is active
|
||||||
if hasDisplaySleepAssertion; then
|
if hasDisplaySleepAssertion; then
|
||||||
@@ -75,7 +98,7 @@ printlog "Label type: $type" INFO
|
|||||||
# MARK: extract info from data
|
# MARK: extract info from data
|
||||||
if [ -z "$archiveName" ]; then
|
if [ -z "$archiveName" ]; then
|
||||||
case $type in
|
case $type in
|
||||||
dmg|pkg|zip|tbz)
|
dmg|pkg|zip|tbz|bz2)
|
||||||
archiveName="${name}.$type"
|
archiveName="${name}.$type"
|
||||||
;;
|
;;
|
||||||
pkgInDmg)
|
pkgInDmg)
|
||||||
@@ -101,7 +124,7 @@ fi
|
|||||||
|
|
||||||
if [ -z "$targetDir" ]; then
|
if [ -z "$targetDir" ]; then
|
||||||
case $type in
|
case $type in
|
||||||
dmg|zip|tbz|app*)
|
dmg|zip|tbz|bz2|app*)
|
||||||
targetDir="/Applications"
|
targetDir="/Applications"
|
||||||
;;
|
;;
|
||||||
pkg*)
|
pkg*)
|
||||||
@@ -282,7 +305,7 @@ case $type in
|
|||||||
zip)
|
zip)
|
||||||
installFromZIP
|
installFromZIP
|
||||||
;;
|
;;
|
||||||
tbz)
|
tbz|bz2)
|
||||||
installFromTBZ
|
installFromTBZ
|
||||||
;;
|
;;
|
||||||
pkgInDmg)
|
pkgInDmg)
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ echo "archivePath: $archivePath"
|
|||||||
# So we want to investigate which one has the filename
|
# So we want to investigate which one has the filename
|
||||||
try1archiveName=${${archiveTempName##*/}%%\?*}
|
try1archiveName=${${archiveTempName##*/}%%\?*}
|
||||||
try2archiveName=${${archivePath##*/}%%\?*}
|
try2archiveName=${${archivePath##*/}%%\?*}
|
||||||
fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz|gz)$' # regular expression for matching
|
fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz|gz|bz2)$' # regular expression for matching
|
||||||
if [[ "${try1archiveName}" =~ $fileName_re ]]; then
|
if [[ "${try1archiveName}" =~ $fileName_re ]]; then
|
||||||
archiveName=${try1archiveName}
|
archiveName=${try1archiveName}
|
||||||
elif [[ "${try2archiveName}" =~ $fileName_re ]]; then
|
elif [[ "${try2archiveName}" =~ $fileName_re ]]; then
|
||||||
@@ -293,7 +293,7 @@ if [ "$archiveExt" = "pkg" ]; then
|
|||||||
elif [ "$archiveExt" = "dmg" ]; then
|
elif [ "$archiveExt" = "dmg" ]; then
|
||||||
echo "Diskimage found"
|
echo "Diskimage found"
|
||||||
dmgInvestigation
|
dmgInvestigation
|
||||||
elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ] || [ "$archiveExt" = "bz2" ]; then
|
||||||
echo "Compressed file found"
|
echo "Compressed file found"
|
||||||
# unzip the archive
|
# unzip the archive
|
||||||
tar -xf "$archiveName"
|
tar -xf "$archiveName"
|
||||||
|
|||||||
@@ -52,9 +52,22 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
|||||||
gitusername=${1?:"no git user name"}
|
gitusername=${1?:"no git user name"}
|
||||||
gitreponame=${2?:"no git repo name"}
|
gitreponame=${2?:"no git repo name"}
|
||||||
|
|
||||||
|
if [[ $type == "pkgInDmg" ]]; then
|
||||||
|
filetype="dmg"
|
||||||
|
elif [[ $type == "pkgInZip" ]]; then
|
||||||
|
filetype="zip"
|
||||||
|
else
|
||||||
|
filetype=$type
|
||||||
|
fi
|
||||||
|
|
||||||
#githubPart="$gitusername/$gitreponame/releases/download"
|
#githubPart="$gitusername/$gitreponame/releases/download"
|
||||||
#echo "$githubPart"
|
#echo "$githubPart"
|
||||||
downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest"
|
#downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest"
|
||||||
|
if [ -n "$archiveName" ]; then
|
||||||
|
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1)
|
||||||
|
else
|
||||||
|
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)
|
||||||
|
fi
|
||||||
echo "$downloadURL"
|
echo "$downloadURL"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -63,7 +76,7 @@ versionFromGit() { # $1 git user name, $2 git repo name
|
|||||||
gitusername=${1?:"no git user name"}
|
gitusername=${1?:"no git user name"}
|
||||||
gitreponame=${2?:"no git repo name"}
|
gitreponame=${2?:"no git repo name"}
|
||||||
|
|
||||||
appNewVersion=$(curl --silent --fail "https://github.com/$gitusername/$gitreponame/releases/latest" | sed -E 's/.*tag\/(.*)\">.*/\1/g' | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
if [ -z "$appNewVersion" ]; then
|
if [ -z "$appNewVersion" ]; then
|
||||||
printlog "could not retrieve version number for $gitusername/$gitreponame: $appNewVersion"
|
printlog "could not retrieve version number for $gitusername/$gitreponame: $appNewVersion"
|
||||||
exit 9
|
exit 9
|
||||||
@@ -182,13 +195,14 @@ for fixedArch in i386 arm64; do
|
|||||||
|
|
||||||
#caseLabel
|
#caseLabel
|
||||||
if cat "${labels_dir}/${label}.sh" | grep -v -E '^[a-z0-9\_-]*(\)|\|\\)$' | grep -v ";;" > checkLabelCurrent.sh; then
|
if cat "${labels_dir}/${label}.sh" | grep -v -E '^[a-z0-9\_-]*(\)|\|\\)$' | grep -v ";;" > checkLabelCurrent.sh; then
|
||||||
|
INSTALL=force # This is only to prevent various Microsoft labels from running "msupdate --list"
|
||||||
source checkLabelCurrent.sh
|
source checkLabelCurrent.sh
|
||||||
|
|
||||||
echo "Name: $name"
|
echo "Name: $name"
|
||||||
echo "Download URL: $downloadURL"
|
echo "Download URL: $downloadURL"
|
||||||
echo "Type: $type"
|
echo "Type: $type"
|
||||||
case $type in
|
case $type in
|
||||||
dmg|pkg|zip|tbz)
|
dmg|pkg|zip|tbz|bz2)
|
||||||
expectedExtension="$type"
|
expectedExtension="$type"
|
||||||
;;
|
;;
|
||||||
pkgInDmg)
|
pkgInDmg)
|
||||||
|
|||||||
Reference in New Issue
Block a user