From 9f4584deb807b84a36971ecc79196a635d9abd8e Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Thu, 10 Oct 2024 13:18:16 +1100 Subject: [PATCH] bot-framework-emulator: update livecheck --- Casks/b/bot-framework-emulator.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Casks/b/bot-framework-emulator.rb b/Casks/b/bot-framework-emulator.rb index 0f16cad5409bd..9a721768e3849 100644 --- a/Casks/b/bot-framework-emulator.rb +++ b/Casks/b/bot-framework-emulator.rb @@ -7,6 +7,25 @@ desc "Test and debug chat bots built with the Bot Framework SDK" homepage "https://github.com/Microsoft/BotFramework-Emulator" + # Not every GitHub release provides a file for macOS, so we check multiple + # recent releases instead of only the "latest" release. + livecheck do + url :url + regex(/^botframework[._-]emulator.*?v?(\d+(?:\.\d+)+)[._-]mac\.(?:dmg|pkg|zip)$/i) + strategy :github_releases do |json, regex| + json.map do |release| + next if release["draft"] || release["prerelease"] + + release["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.blank? + + match[1] + end + end.flatten + end + end + auto_updates true app "Bot Framework Emulator.app"