# generated by duploctl pipeline, do no edit
class Duploctl < Formula

  desc "{description}"
  homepage "{repo_url}"
  version "{version}"
  license "MIT"
  base_url = "#{{homepage}}/releases/download/v#{{version}}"

  option "with-pip", "Use Brew PIP to install duploctl"

  if build.with? "pip"
    include Language::Python::Virtualenv
    url "#{{base_url}}/duplocloud-client-#{{version}}.tar.gz"
    sha256 "{pip_sha}"
    depends_on "python@3.12"
    {resources}
    def install
      virtualenv_install_with_resources
    end
  else
    on_macos do
      url "#{{base_url}}/duploctl-#{{version}}-darwin-amd64.tar.gz"
      sha256 "{macos_sha}"
    end
  
    on_linux do
      url "#{{base_url}}/duploctl-#{{version}}-linux-amd64.tar.gz"
      sha256 "{linux_sha}"
    end
  
    def install
      bin.install "duploctl"
    end
  end

  test do
    system "duploctl --version"
  end
end
