buildLabel.sh and airtame

This commit is contained in:
Søren Theilgaard
2021-09-03 14:01:06 +02:00
parent ca17fa3c6b
commit 44a64b83b9
6 changed files with 40 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ adobereaderdc-install
adobereaderdc-update
aircall
airserver
airtame
aldente
alfred
alttab

View File

@@ -1,10 +0,0 @@
cdef)
# cdef currently not signed
# credit: Søren Theilgaard (@theilgaard)
name="cdef"
type="pkg"
downloadURL=$(downloadURLFromGit Shufflepuck cdef)
appNewVersion=$(versionFromGit Shufflepuck cdef)
#expectedTeamID="EM3ER8T33A"
;;

View File

@@ -0,0 +1,7 @@
airtame)
name="Airtame"
type="dmg"
downloadURL="$(curl -fs https://airtame.com/download/ | grep -i platform=mac | head -1 | grep -o -i -E "https.*" | cut -d '"' -f1)"
appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^location | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g')"
expectedTeamID="4TPSP88HN2"
;;

View File

@@ -1,7 +1,7 @@
screencloudplayer)
# credit: AP Orlebeke (@apizz)
name="ScreenCloud Player"
type="dmg"
downloadURL=$(curl -sL "https://screencloud.com/download" | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p')
expectedTeamID="3C4F953K6P"
;;
# credit: AP Orlebeke (@apizz)
name="ScreenCloud Player"
type="dmg"
downloadURL=$(curl -sL "https://screencloud.com/download" | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p')
expectedTeamID="3C4F953K6P"
;;

View File

@@ -2,7 +2,7 @@
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
downloadURL=${1?:"need to provide a download URL"}
downloadURL=${1?:"need to provide a download URL."}
# Note: this tool _very_ experimental and does not work in many cases
# That being said, it's a great place to start for building up the label in the Case-statement
@@ -10,19 +10,23 @@ downloadURL=${1?:"need to provide a download URL"}
# Usage
# ./buildLabel.sh <URL to download software>
tmpDir=$(pwd) # use working directory as download folder (REMEMBER to comment out removal of tmpDir in bottom of script)
# Use working directory as download folder
tmpDir=$(date "+%Y-%m-%d-%H-%M-%S")
# Create a n almost unique folder name
mkdir $tmpDir
# change directory to temporary working directory
echo "Changing directory to $tmpDir"
if ! cd "$tmpDir"; then
echo "error changing directory $tmpDir"
#rm -Rf "$tmpDir"
echo "Error changing directory $tmpDir"
exit 1
fi
echo "Working dir: $(pwd)"
# download the URL
echo "Downloading $downloadURL"
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
echo "Redirecting to (maybe this can help us with version):\n$(curl -fsIL "$downloadURL" | grep -i ^location)"
if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
echo "error downloading $downloadURL"
exit 2
fi
@@ -60,12 +64,25 @@ appInvestigation() {
exit 4
fi
}
echo "downloadOut: ${downloadOut}"
echo "downloadOut:\n${downloadOut}"
archiveTempName=$( echo "${downloadOut}" | head -1 )
echo "archiveTempName: $archiveTempName"
archivePath=$( echo "${downloadOut}" | tail -1 )
echo "archivePath: $archivePath"
archiveName=${archivePath##*/}
try1archiveName=${archiveTempName##*/}
try2archiveName=${archivePath##*/}
fileName_re='^([a-zA-Z0-9\_.-]*)\.(dmg|pkg|zip|tbz)$'
if [[ "${try1archiveName}" =~ $fileName_re ]]; then
archiveName=${try1archiveName}
elif [[ "${try2archiveName}" =~ $fileName_re ]]; then
archiveName=${try2archiveName}
else
echo "Could not determine archiveName from “$try1archiveName” and “$try2archiveName"
exit
fi
echo "archiveName: $archiveName"
mv $archiveTempName $archiveName
name=${archiveName%.*}
@@ -125,7 +142,7 @@ echo "**********"
echo
echo "Labels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed."
echo
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
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"
echo
echo "$identifier)"
echo " name=\"$name\""