Update brave.sh

This is a special construction of the `appNewVersion` variable. Not sure this is future proof, but the current one was not working.
This commit is contained in:
Søren Theilgaard
2022-01-03 09:09:30 +01:00
parent 1fdbef74c1
commit 61b05ff31e

View File

@@ -1,15 +1,14 @@
brave) brave)
# credit: @securitygeneration
name="Brave Browser" name="Brave Browser"
type="dmg" type="dmg"
if [[ $(arch) != "i386" ]]; then if [[ $(arch) != "i386" ]]; then
printlog "Architecture: arm64 (not i386)" printlog "Architecture: arm64 (not i386)"
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n') downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}')
else else
printlog "Architecture: i386" printlog "Architecture: i386"
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n') downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}')
fi fi
# downloadURL=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) # downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
appNewVersion=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2) appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)"
expectedTeamID="KL8N8XSYF4" expectedTeamID="KL8N8XSYF4"
;; ;;