Skip to content

Commit

Permalink
Merge pull request #184640 from Homebrew/yubico-authenticator-livecheck
Browse files Browse the repository at this point in the history
yubico-authenticator: update livecheck
  • Loading branch information
bevanjkay committed Sep 8, 2024
2 parents 44b6646 + de7a7fe commit 927af47
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Casks/y/yubico-authenticator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
desc "Application for generating TOTP and HOTP codes"
homepage "https://developers.yubico.com/yubioath-flutter/"

# Releases sometimes don't have a macOS build, so we check multiple
# recent releases instead of only the "latest" release. NOTE: We should be
# able to use `strategy :github_latest` when subsequent releases provide
# files for macOS again.
livecheck do
url :url
regex(/^yubico[._-]authenticator[._-]v?(\d+(?:\.\d+)+)[._-]mac\.(?:dmg|pkg)$/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

depends_on macos: ">= :big_sur"

app "Yubico Authenticator.app"
Expand Down

0 comments on commit 927af47

Please sign in to comment.