require 'formula'

class SpringBoot < Formula
  homepage 'https://spring.io/projects/spring-boot'
  url 'https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-cli/4.0.4-SNAPSHOT/spring-boot-cli-4.0.4-SNAPSHOT-bin.tar.gz'
  version '4.0.4-SNAPSHOT'
  sha256 'f7c36bf8d9cca62135e1a174f878ea12c5d44b15d4d41fa14fab0451b0c8dd47'

  def install
    libexec.install Dir["./*"]
    (bin/"spring").write_env_script libexec/"bin/spring", {}

    bash_comp = libexec/"shell-completion/bash/spring"
    zsh_comp  = libexec/"shell-completion/zsh/_spring"

    bash_completion.install bash_comp if bash_comp.exist?
    zsh_completion.install  zsh_comp  if zsh_comp.exist?
  end
end
