From fb8ee52992475fd81d55ff1dfc8ce0ee54b1dfaf Mon Sep 17 00:00:00 2001 From: sewn Date: Fri, 3 Nov 2023 11:32:05 +0300 Subject: [PATCH] roblox/bootstrapper: print manif url, fix check manif len --- roblox/bootstrapper/manifest.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/roblox/bootstrapper/manifest.go b/roblox/bootstrapper/manifest.go index 2a68e9d7..e4065504 100644 --- a/roblox/bootstrapper/manifest.go +++ b/roblox/bootstrapper/manifest.go @@ -50,15 +50,22 @@ func FetchManifest(ver *version.Version) (Manifest, error) { return Manifest{}, err } durl := cdn + channelPath(ver.Channel) + ver.GUID + url := durl + "-rbxPkgManifest.txt" - log.Printf("Fetching manifest for %s (%s)", ver.GUID, durl) + log.Printf("Fetching manifest for %s (%s)", ver.GUID, url) - manif, err := util.Body(durl + "-rbxPkgManifest.txt") + smanif, err := util.Body(url) if err != nil { return Manifest{}, fmt.Errorf("fetch %s manifest: %w", ver.GUID, err) } - pkgs, err := ParsePackages(strings.Split(manif, "\r\n")) + // Because the manifest ends with also a newline, it has to be removed. + manif := strings.Split(smanif, "\r\n") + if len(manif) > 0 && manif[len(manif)-1] == "" { + manif = manif[:len(manif)-1] + } + + pkgs, err := ParsePackages(manif) if err != nil { return Manifest{}, err }