From 40d0a60a65a3fc9fa7ffebfe8711b7d5acb6325b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=BCbner?= Date: Mon, 15 May 2023 18:28:24 +0200 Subject: [PATCH] quilt get latest installer version from maven meta --- server/quilt.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/quilt.go b/server/quilt.go index 7605677..688aa49 100644 --- a/server/quilt.go +++ b/server/quilt.go @@ -3,6 +3,7 @@ package server import ( "errors" "fmt" + "github.com/nothub/mrpack-install/maven" "github.com/nothub/mrpack-install/requester" "github.com/nothub/mrpack-install/util" "os" @@ -10,14 +11,18 @@ import ( "path" ) -const quiltInstallerUrl = "https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/0.5.0/quilt-installer-0.5.0.jar" - type Quilt struct { MinecraftVersion string QuiltVersion string } func (provider *Quilt) Provide(serverDir string, serverFile string) error { + meta, err := maven.FetchMetadata("https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/maven-metadata.xml") + if err != nil { + return err + } + quiltInstallerUrl := "https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/" + meta.Versioning.Release + "/quilt-installer-" + meta.Versioning.Release + ".jar" + installer, err := requester.DefaultHttpClient.DownloadFile(quiltInstallerUrl, ".", "") if err != nil { return err