# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Eksctl < Formula
    desc "The official CLI for Amazon EKS"
    homepage "https://docs.aws.amazon.com/eks/latest/eksctl/"
    version "0.215.0"
  
    depends_on "kubernetes-cli"
    depends_on "aws-iam-authenticator"
  
    on_macos do
      if Hardware::CPU.arm?
        url "https://github.com/eksctl-io/eksctl/releases/download/v0.215.0/eksctl_Darwin_arm64.tar.gz"
        sha256 "02040a9dfd26352f8525133b807cb675b75abb4640d900994b94d69e937444d8"
  
        def install
          bin.install "eksctl"
  
          # Install bash completion
          output = Utils.popen_read("#{bin}/eksctl completion bash")
          (bash_completion/"eksctl").write output
  
          # Install zsh completion
          output = Utils.popen_read("#{bin}/eksctl completion zsh")
          (zsh_completion/"_eksctl").write output
        end
      end
      if Hardware::CPU.intel?
        url "https://github.com/eksctl-io/eksctl/releases/download/v0.215.0/eksctl_Darwin_amd64.tar.gz"
        sha256 "bb9081b0c45f33a4f8c827029bcd21d07ad234327444d0b4d75f76da73076520"
  
        def install
          bin.install "eksctl"
  
          # Install bash completion
          output = Utils.popen_read("#{bin}/eksctl completion bash")
          (bash_completion/"eksctl").write output
  
          # Install zsh completion
          output = Utils.popen_read("#{bin}/eksctl completion zsh")
          (zsh_completion/"_eksctl").write output
        end
      end
    end
  
    on_linux do
      if Hardware::CPU.intel?
        url "https://github.com/eksctl-io/eksctl/releases/download/v0.215.0/eksctl_Linux_amd64.tar.gz"
        sha256 "8d17b7709c0109cb7477d681fb112e9a19dc91e4b4aacb881c2c3fad734c6683"
  
        def install
          bin.install "eksctl"
  
          # Install bash completion
          output = Utils.popen_read("#{bin}/eksctl completion bash")
          (bash_completion/"eksctl").write output
  
          # Install zsh completion
          output = Utils.popen_read("#{bin}/eksctl completion zsh")
          (zsh_completion/"_eksctl").write output
        end
      end
      if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
        url "https://github.com/eksctl-io/eksctl/releases/download/v0.215.0/eksctl_Linux_arm64.tar.gz"
        sha256 "2c02b7ad1122413d118a8b05cd194e7d9d9b9ba4cb7a77b5977f5d53ff66ba75"
  
        def install
          bin.install "eksctl"
  
          # Install bash completion
          output = Utils.popen_read("#{bin}/eksctl completion bash")
          (bash_completion/"eksctl").write output
  
          # Install zsh completion
          output = Utils.popen_read("#{bin}/eksctl completion zsh")
          (zsh_completion/"_eksctl").write output
        end
      end
      if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
        url "https://github.com/eksctl-io/eksctl/releases/download/v0.215.0/eksctl_Linux_armv6.tar.gz"
        sha256 "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5"
  
        def install
          bin.install "eksctl"
  
          # Install bash completion
          output = Utils.popen_read("#{bin}/eksctl completion bash")
          (bash_completion/"eksctl").write output
  
          # Install zsh completion
          output = Utils.popen_read("#{bin}/eksctl completion zsh")
          (zsh_completion/"_eksctl").write output
        end
      end
    end
  
    head "https://github.com/eksctl-io/eksctl/releases/download/latest_release/eksctl_Darwin_amd64.tar.gz"
  end
