Browse Source

Clementine latest (#4644)

* Add Clementine Latest

* Fix install permission

* Fix stanzas

* Use url block to download latest version

* Fix on uninstall by not setting read-only

* Fix code style
master
Manassarn Manoonchai 7 years ago
committed by Miccal Matthews
parent
commit
aa2b7047d1
  1. 38
      Casks/clementine-latest.rb

38
Casks/clementine-latest.rb

@ -0,0 +1,38 @@
cask 'clementine-latest' do
version :latest
sha256 :no_check
url do
require 'open-uri'
last_modified_query = '?C=M;O=D'
base_url = 'https://builds.clementine-player.org/mac/'
file = open("#{base_url}#{last_modified_query}")
.read
.scan(%r{href="(clementine-[^"]+.dmg)"})
.flatten
.first
"#{base_url}#{file}"
end
name 'Clementine'
homepage 'https://www.clementine-player.org/'
conflicts_with cask: [
'clementine',
'clementine-rc',
]
app 'Clementine.app'
preflight do
set_permissions "#{staged_path}/Clementine.app", '0755'
end
zap delete: [
'~/Library/Caches/org.clementine-player.Clementine',
'~/Library/Saved Application State/org.clementine-player.Clementine.savedState',
],
trash: [
'~/Library/Application Support/Clementine',
'~/Library/Preferences/org.clementine-player.Clementine.plist',
]
end
Loading…
Cancel
Save