# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Godownloader < Formula
  desc "This is the inverse of goreleaser. The goreleaser YAML file is read and
creates a custom shell script that can download the right package and
the right version for the existing machine.
"
  homepage "https://github.com/kamilsk/godownloader"
  version "0.1.0"

  on_macos do
    if Hardware::CPU.arm?
      url "https://github.com/kamilsk/godownloader/releases/download/v0.1.0/godownloader_0.1.0_macOS-64bit_arm.tar.gz"
      sha256 "92513bc0d3ee262c56d7a87f4377569534aa284f8d5332f556c8f69e59f42210"

      def install
        bin.install "godownloader"
        prefix.install_metafiles
      end
    end
    if Hardware::CPU.intel?
      url "https://github.com/kamilsk/godownloader/releases/download/v0.1.0/godownloader_0.1.0_macOS-64bit_x86.tar.gz"
      sha256 "6c8b05d3c1d50687e8b78677fa6089170e27436efa8e98a0178988819063fa47"

      def install
        bin.install "godownloader"
        prefix.install_metafiles
      end
    end
  end

  on_linux do
    if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
      url "https://github.com/kamilsk/godownloader/releases/download/v0.1.0/godownloader_0.1.0_Linux-64bit_arm.tar.gz"
      sha256 "4bd3c61efad76e3aa29a355ec563ca377f5b30c43c359ad7e878ff639b3d987a"

      def install
        bin.install "godownloader"
        prefix.install_metafiles
      end
    end
    if Hardware::CPU.intel?
      url "https://github.com/kamilsk/godownloader/releases/download/v0.1.0/godownloader_0.1.0_Linux-64bit_x86.tar.gz"
      sha256 "fc40ad85ead65e82e9ed72f5f9653d3d93c11767230f5ad87a2e9e6b692e842d"

      def install
        bin.install "godownloader"
        prefix.install_metafiles
      end
    end
  end

  test do
    system "#{bin}/godownloader help"
  end
end
