From 3389119d03ad469cd293c2dda9328db2b5d4746d Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 16:16:13 -0700 Subject: [PATCH] fixed path madness --- fclauncher/InstanceManager.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index f00dcb4..56e1ce7 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -336,7 +336,6 @@ func (i *InstanceManager) InstallFabric(instance string, fabricVersion string) { client: for _, lib := range metadata.LauncherMeta.Libraries.Client { tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) - fmt.Printf("processing lib %s as path %s with %d tokens", lib.Name, ProcessMavenPath(lib.Name), len(tokens)) pkg := tokens[len(tokens)-2] instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))) for ind, path := range instanceObject.Libraries { @@ -351,11 +350,10 @@ client: common: for _, lib := range metadata.LauncherMeta.Libraries.Common { tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) - fmt.Printf("processing lib %s as path %s with %d tokens", lib.Name, ProcessMavenPath(lib.Name), len(tokens)) pkg := tokens[len(tokens)-2] instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))) for ind, path := range instanceObject.Libraries { - tokens := strings.Split(path, string(os.PathSeparator)) + tokens := strings.Split(path, "/") if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) @@ -413,7 +411,7 @@ common: pkg := tokens[len(tokens)-2] instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))) for ind, path := range instanceObject.Libraries { - tokens := strings.Split(path, string(os.PathSeparator)) + tokens := strings.Split(path, "/") if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg)