# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Gosmee < Formula
  desc "gosmee - A webhook and https://smee.io forwarder"
  homepage "https://github.com/chmouel/gosmee"
  version "0.28.0"

  on_macos do
    url "https://github.com/chmouel/gosmee/releases/download/v0.28.0/gosmee_0.28.0_darwin_all.tar.gz"
    sha256 "fbbda6120fb53cca654fec2c8ea52a7dea11dc15e13e282e0598d0d98a758a50"

    def install
      bin.install "gosmee" => "gosmee"
      output = Utils.popen_read("SHELL=bash #{bin}/gosmee completion bash")
      (bash_completion/"gosmee").write output
      output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion zsh")
      (zsh_completion/"_gosmee").write output
      output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion fish")
      (fish_completion/"gosmee.fish").write output
      prefix.install_metafiles
    end
  end

  on_linux do
    if Hardware::CPU.intel? and Hardware::CPU.is_64_bit?
      url "https://github.com/chmouel/gosmee/releases/download/v0.28.0/gosmee_0.28.0_linux_x86_64.tar.gz"
      sha256 "44282e19dbb265edf83de4d74e43a56bc27a7b8437683c0fe5fd937b42ee543a"
      def install
        bin.install "gosmee" => "gosmee"
        output = Utils.popen_read("SHELL=bash #{bin}/gosmee completion bash")
        (bash_completion/"gosmee").write output
        output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion zsh")
        (zsh_completion/"_gosmee").write output
        output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion fish")
        (fish_completion/"gosmee.fish").write output
        prefix.install_metafiles
      end
    end
    if Hardware::CPU.arm? and Hardware::CPU.is_64_bit?
      url "https://github.com/chmouel/gosmee/releases/download/v0.28.0/gosmee_0.28.0_linux_arm64.tar.gz"
      sha256 "e609133188fa7b5206ed364a931cfb65e99914d5cb57d5609465a38a5ec185a7"
      def install
        bin.install "gosmee" => "gosmee"
        output = Utils.popen_read("SHELL=bash #{bin}/gosmee completion bash")
        (bash_completion/"gosmee").write output
        output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion zsh")
        (zsh_completion/"_gosmee").write output
        output = Utils.popen_read("SHELL=zsh #{bin}/gosmee completion fish")
        (fish_completion/"gosmee.fish").write output
        prefix.install_metafiles
      end
    end
  end
end
