Merge pull request #194004 from Homebrew/bump-binance-1.54.4
[Homebrew/homebrew-cask.git] / Casks / k / klogg.rb
blob417a14010351908f015bb77d8312ae0673df0acb
1 cask "klogg" do
2   version "22.06.0.1289"
3   sha256 "e5df7722d0d851852dd9cc3449dd42d1fef3e74edda8c20dc04b38cb852b0fec"
5   url "https://github.com/variar/klogg/releases/download/v#{version.major_minor}/klogg-#{version}-OSX-Qt5.dmg"
6   name "Klogg"
7   desc "Fast, advanced log explorer"
8   homepage "https://github.com/variar/klogg"
10   livecheck do
11     url :url
12     regex(/^klogg[._-]v?(\d+(?:\.\d+)+)-OSX-Qt5\.dmg$/i)
13     strategy :github_latest do |json, regex|
14       json["assets"]&.map do |asset|
15         match = asset["name"]&.match(regex)
16         next if match.blank?
18         match[1]
19       end
20     end
21   end
23   app "klogg.app"
24   # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
25   shimscript = "#{staged_path}/klogg.wrapper.sh"
26   binary shimscript, target: "klogg"
28   preflight do
29     File.write shimscript, <<~EOS
30       #!/bin/sh
31       exec '#{appdir}/klogg.app/Contents/MacOS/klogg' "$@"
32     EOS
33   end
35   zap trash: [
36     "~/Library/Application Support/klogg",
37     "~/Library/Preferences/com.klogg.klogg.plist",
38     "~/Library/Preferences/com.klogg.klogg_session.plist",
39     "~/Library/Saved Application State/com.github.variar.klogg.savedState",
40   ]
42   caveats do
43     requires_rosetta
44   end
45 end