Skip to content

Commit

Permalink
roam: update livecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
khipp committed Aug 9, 2024
1 parent f7a9777 commit a9e2264
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Casks/r/roam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
homepage "https://ro.am/"

livecheck do
url :url
strategy :extract_plist
url "https://ro.am/release-notes"
regex(/version:\s*"([^"]+)"/i)
strategy :page_match do |page, regex|
js_match = page[/src=.*(index[._-]\w+\.js)/i, 1]
next if js_match.blank?

js_page = Homebrew::Livecheck::Strategy.page_content("https://ro.am/website/#{js_match}")
js_page[:content]&.scan(regex)&.map { |match| match[0] }
end
end

auto_updates true
Expand Down

0 comments on commit a9e2264

Please sign in to comment.