class SwitcherooNx < Formula
  desc "A cross platform CLI and GUI for the Nintendo Switch RCM exploit"
  homepage "https://github.com/budde25/switcheroo"
  if Hardware::CPU.type == :arm
    url "https://github.com/budde25/switcheroo/releases/download/v0.6.0/switcheroo-nx-aarch64-apple-darwin.tar.xz"
    sha256 "b695217b2463167f7f3630580f063a7c9665abd5083bd296b20b190d3be44824"
  else
    url "https://github.com/budde25/switcheroo/releases/download/v0.6.0/switcheroo-nx-x86_64-apple-darwin.tar.xz"
    sha256 "9054dace0b350282869b6b20aebc518db2a8996325844a8f12542e8084847b7b"
  end
  version "0.6.0"
  license "GPL-2.0-or-later"

  def install
    bin.install "switcheroo"

    # Homebrew will automatically install these, so we don't need to do that
    doc_files = Dir["README.*", "readme.*", "LICENSE", "LICENSE.*", "CHANGELOG.*"]
    leftover_contents = Dir["*"] - doc_files

    # Install any leftover files in pkgshare; these are probably config or
    # sample files.
    pkgshare.install *leftover_contents unless leftover_contents.empty?
  end
end
