class Flyway < Formula desc "Database version control to control migrations" homepage "https://flywaydb.org/" url "https://search.maven.org/remotecontent?filepath=org/flywaydb/flyway-commandline/9.14.1/flyway-commandline-9.14.1.tar.gz" sha256 "6b8c00a5a7b4f2840154e4af2c915f534641f263896e3b270ff4a0a42aba2187" license "Apache-2.0" livecheck do url "https://search.maven.org/remotecontent?filepath=org/flywaydb/flyway-commandline/maven-metadata.xml" regex(%r{v?(\d+(?:\.\d+)+)}i) end bottle do sha256 cellar: :any_skip_relocation, all: "1ea1b0afe0211e37b2f17a52f28531cf281bcfa0592564aef5902d32090aee25" end depends_on "openjdk" def install rm Dir["*.cmd"] chmod "g+x", "flyway" libexec.install Dir["*"] (bin/"flyway").write_env_script libexec/"flyway", JAVA_HOME: Formula["openjdk"].opt_prefix end test do system "#{bin}/flyway", "-url=jdbc:h2:mem:flywaydb", "validate" end end