phinze/homebrew-cask

View on GitHub
Casks/h/headlamp.rb

Summary

Maintainability
A
0 mins
Test Coverage
cask "headlamp" do
  arch arm: "arm64", intel: "x64"

  version "0.25.1"
  sha256 arm:   "3292bd47a9e880753d9550520ff153bfdcdd17e4444f2ff6f1af6b02846e372a",
         intel: "d840939f86a325779df22b8e00e9d8b108fe80bd603ef5433b4dbcef9073b1ea"

  url "https://github.com/headlamp-k8s/headlamp/releases/download/v#{version.sub(/-\d+/, "")}/Headlamp-#{version}-mac-#{arch}.dmg",
      verified: "github.com/headlamp-k8s/headlamp/"
  name "Headlamp"
  desc "UI for Kubernetes"
  homepage "https://headlamp.dev/"

  livecheck do
    url :url
    regex(/Headlamp[._-]v?(\d+(?:[.-]\d+)+)-mac-#{arch}/i)
    strategy :github_latest do |json, regex|
      json["assets"]&.map do |asset|
        match = asset["name"]&.match(regex)
        next if match.blank?

        match[1]
      end
    end
  end

  depends_on macos: ">= :catalina"

  app "Headlamp.app"

  uninstall quit: "com.kinvolk.headlamp"

  zap trash: [
    "~/Library/Application Support/Headlamp",
    "~/Library/Logs/Headlamp",
    "~/Library/Preferences/com.kinvolk.headlamp.plist",
  ]
end