Skip to content

Commit

Permalink
quilt get latest installer version from maven meta
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed May 15, 2023
1 parent a5d2f9a commit 40d0a60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/quilt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ package server
import (
"errors"
"fmt"
"github.com/nothub/mrpack-install/maven"
"github.com/nothub/mrpack-install/requester"
"github.com/nothub/mrpack-install/util"
"os"
"os/exec"
"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
Expand Down

0 comments on commit 40d0a60

Please sign in to comment.