homebrew-cask/Casks/origin.rb

28 lines
1004 B
Ruby

cask "origin" do
version "10.5.66.38849"
sha256 "ca53f5ae24c73a8099ebb02644d4bbb3479e0fa6e4344277d84b63a088c1c552"
# origin-a.akamaihd.net/ was verified as official when first introduced to the cask
url "https://origin-a.akamaihd.net/Origin-Client-Download/origin/mac/live/OriginUpdate_#{version.dots_to_underscores}.zip"
appcast "https://api1.origin.com/autopatch/2/upgradeFrom/#{version}/en_US/PROD?platform=MAC&osVersion=10.14.0"
name "Origin"
homepage "https://www.origin.com/"
auto_updates true
app "Origin.app"
preflight do
# There is no enclosing .app folder, just the 'Contents' of the app in the appcast download
FileUtils.mv(staged_path.children, staged_path.join("Origin.app").tap(&:mkpath))
end
zap trash: [
"~/Library/Application Support/Origin",
"~/Library/Saved Application State/com.ea.Origin.savedState",
"~/Library/LaunchAgents/com.ea.origin.WebHelper.plist",
"~/Library/Caches/com.ea.Origin",
"~/Library/Caches/Origin",
]
end