# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Policy < Formula
  desc "policy CLI for building and managing authorization policies"
  homepage "https://aserto.com/"
  version "0.1.30"
  license "Apache License Version 2.0"

  on_macos do
    if Hardware::CPU.intel?
      url "https://github.com/opcr-io/policy/releases/download/v0.1.30/policy0.1.30_darwin_x86_64.zip"
      sha256 "20963fec75b7ce5fc176df5d7177324dbaf90502330a0c2beef8f539c8e6a4b8"

      def install
        bin.install "policy"
      end
    end
    if Hardware::CPU.arm?
      url "https://github.com/opcr-io/policy/releases/download/v0.1.30/policy0.1.30_darwin_arm64.zip"
      sha256 "482deb1ec1b004c59df8e8e9587ee446c9cf4a02f378946bc08d9256f0034b46"

      def install
        bin.install "policy"
      end
    end
  end

  on_linux do
    if Hardware::CPU.intel?
      url "https://github.com/opcr-io/policy/releases/download/v0.1.30/policy0.1.30_linux_x86_64.zip"
      sha256 "0c1db17fbf41295bfabe5b53e737ff4631116f01fd717ba5cbd4f7d7e9aab5ec"

      def install
        bin.install "policy"
      end
    end
    if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
      url "https://github.com/opcr-io/policy/releases/download/v0.1.30/policy0.1.30_linux_arm64.zip"
      sha256 "f02713d5de87a65f295e6aa15ab2c878aee1a4d19fafef070d69a3591222605f"

      def install
        bin.install "policy"
      end
    end
  end

  test do
    system "#{bin}/policy version"
  end
end
