# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Ec2SpotInterrupter < Formula
  desc "A simple CLI tool that triggers Amazon EC2 Spot Interruption Notifications and Rebalance Recommendations."
  homepage "https://github.com/aws/amazon-ec2-spot-interrupter"
  version "0.0.10"
  license "Apache-2"

  on_macos do
    if Hardware::CPU.arm?
      url "https://github.com/aws/amazon-ec2-spot-interrupter/releases/download/v0.0.10/ec2-spot-interrupter_0.0.10_Darwin_arm64.tar.gz"
      sha256 "fdaaf998cc1baab7cfdd6bdecee394ffba914738696cb731c630e3d41fdcdf20"

      def install
        bin.install "ec2-spot-interrupter"
      end
    end
    if Hardware::CPU.intel?
      url "https://github.com/aws/amazon-ec2-spot-interrupter/releases/download/v0.0.10/ec2-spot-interrupter_0.0.10_Darwin_amd64.tar.gz"
      sha256 "6c80f89ffb176f7c06eebc2a7233c066e6bd601f09c41a60ef18a6d7d43eabe9"

      def install
        bin.install "ec2-spot-interrupter"
      end
    end
  end

  on_linux do
    if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
      url "https://github.com/aws/amazon-ec2-spot-interrupter/releases/download/v0.0.10/ec2-spot-interrupter_0.0.10_Linux_armv6.tar.gz"
      sha256 "fdf4381bfaaa0b697dd04f9edacba0c391f5876661243043aa8eea4cdf5ff2c8"

      def install
        bin.install "ec2-spot-interrupter"
      end
    end
    if Hardware::CPU.intel?
      url "https://github.com/aws/amazon-ec2-spot-interrupter/releases/download/v0.0.10/ec2-spot-interrupter_0.0.10_Linux_amd64.tar.gz"
      sha256 "e8a946b2b20504e3aa666bd91ae2b60c68c328712e848cb1d6520866a5865070"

      def install
        bin.install "ec2-spot-interrupter"
      end
    end
  end

  def caveats
    <<~EOS
      ec2-spot-interrupter --interactive
    EOS
  end

  test do
    system "#{bin}/program --version"
  end
end
