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.10.1/flyway-commandline-9.10.1.tar.gz" sha256 "c6109a7b4845d55a8124119ef70baf781031fe8f45f159b2f2816cab57f2fc0e" 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: "edb1276b1cbfde99d61929828cab2573fc0724d516b10ebc77bd3e8f6670b199" 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