31 lines
1.1 KiB
Ruby
31 lines
1.1 KiB
Ruby
class FabricInstaller < Formula
|
|
desc "Installer for Fabric for the vanilla launcher"
|
|
homepage "https://fabricmc.net/"
|
|
url "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.11.0/fabric-installer-0.11.0.jar"
|
|
sha256 "68ba42ea4f82ba6d107dd21ad6c5174b80412854ee74919b7234b52d214fd10a"
|
|
license "Apache-2.0"
|
|
|
|
# The first-party download page (https://fabricmc.net/use/) uses JavaScript
|
|
# to create download links, so we check the related JSON data for versions.
|
|
livecheck do
|
|
url "https://meta.fabricmc.net/v2/versions/installer"
|
|
regex(/["']url["']:\s*["'][^"']*?fabric-installer[._-]v?(\d+(?:\.\d+)+)\.jar/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "49c790c1f96aa072ccbcbd70b4b366434069b7102b147e2b10835f709261bee2"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
libexec.install "fabric-installer-#{version}.jar"
|
|
bin.write_jar_script libexec/"fabric-installer-#{version}.jar", "fabric-installer"
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/fabric-installer", "server"
|
|
assert_predicate testpath/"fabric-server-launch.jar", :exist?
|
|
end
|
|
end
|