From 20b8433d34ad7f5f54a8a1334d0f34bd26c7a373 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 16:09:54 -0700 Subject: [PATCH] path separator weridness --- fclauncher/InstanceManager.go | 21 ++++++++++----------- fclauncher/frontend/package.json.md5 | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index 9174ce0..8f6f400 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -335,11 +335,11 @@ func (i *InstanceManager) InstallFabric(instance string, fabricVersion string) { } client: for _, lib := range metadata.LauncherMeta.Libraries.Client { - tokens := strings.Split(ProcessMavenPath(lib.Name), "/") + tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) 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, "/") + tokens := strings.Split(path, string(os.PathSeparator)) if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) @@ -349,12 +349,11 @@ client: } common: for _, lib := range metadata.LauncherMeta.Libraries.Common { - tokens := strings.Split(ProcessMavenPath(lib.Name), "/") - fmt.Printf("Formating lib %s to path %s\n", lib.Name, ProcessMavenPath(lib.Name)) + tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) 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, "/") + tokens := strings.Split(path, string(os.PathSeparator)) if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) @@ -394,11 +393,11 @@ func (i *InstanceManager) InstallQuilt(instance string, quiltVersion string) { } client: for _, lib := range metadata.LauncherMeta.Libraries.Client { - tokens := strings.Split(ProcessMavenPath(lib.Name), "/") + tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) 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, "/") + tokens := strings.Split(path, string(os.PathSeparator)) if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) @@ -408,11 +407,11 @@ client: } common: for _, lib := range metadata.LauncherMeta.Libraries.Common { - tokens := strings.Split(ProcessMavenPath(lib.Name), "/") + tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator)) 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, "/") + tokens := strings.Split(path, string(os.PathSeparator)) if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) @@ -456,11 +455,11 @@ func (i *InstanceManager) InstallForge(instance string, forgeVersion string) { instanceObject.ForgeVersion = forgeVersion outer: for _, lib := range installData.Libraries { - tokens := strings.Split(lib.Downloads.Artifact.Path, "/") + tokens := strings.Split(lib.Downloads.Artifact.Path, string(os.PathSeparator)) pkg := tokens[len(tokens)-2] instanceObject.Libraries = append(instanceObject.Libraries, lib.Downloads.Artifact.Path) for ind, path := range instanceObject.Libraries { - tokens := strings.Split(path, "/") + tokens := strings.Split(path, string(os.PathSeparator)) if pkg == tokens[len(tokens)-3] { instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)) fmt.Printf("duplicate library %s\n", pkg) diff --git a/fclauncher/frontend/package.json.md5 b/fclauncher/frontend/package.json.md5 index 20dd88f..b063894 100755 --- a/fclauncher/frontend/package.json.md5 +++ b/fclauncher/frontend/package.json.md5 @@ -1 +1 @@ -48cb20b8d107dab0a7876a449352234a \ No newline at end of file +ad9da3c17151b053a4d2fda8e3578901 \ No newline at end of file