use getJSONValue

replace sed json parsing with getJSONValue
This commit is contained in:
dnikles
2022-08-01 13:28:26 -04:00
parent 9b5f408c8f
commit ddf5e6da29

View File

@@ -1,7 +1,7 @@
cricutdesignspace) cricutdesignspace)
name="Cricut Design Space" name="Cricut Design Space"
type="dmg" type="dmg"
appNewVersion=$(curl -fsL https://s3-us-west-2.amazonaws.com/staticcontent.cricut.com/a/software/osx-native/latest.json | sed -n 's/^.*"rolloutVersion"[[:space:]]*:[[:space:]]*"\([^"]*\)".*$/\1/p') appNewVersion=$(getJSONValue "$(curl -fsL https://s3-us-west-2.amazonaws.com/staticcontent.cricut.com/a/software/osx-native/latest.json)" "rolloutVersion")
downloadURL=$(curl -fsL "https://apis.cricut.com/desktopdownload/InstallerFile?shard=a&operatingSystem=osxnative&fileName=CricutDesignSpace-Install-v${appNewVersion}.dmg" | sed -n 's/^.*"result"[[:space:]]*:[[:space:]]*"\([^"]*\)".*$/\1/p') downloadURL=$(getJSONValue $(curl -fsL "https://apis.cricut.com/desktopdownload/InstallerFile?shard=a&operatingSystem=osxnative&fileName=CricutDesignSpace-Install-v${appNewVersion}.dmg") "result")
expectedTeamID="25627ZFVT7" expectedTeamID="25627ZFVT7"
;; ;;