more path issues

This commit is contained in:
= 2024-11-26 16:29:58 -07:00
parent 0c111235a6
commit d5f8881d7e

View File

@ -337,11 +337,11 @@ client:
for _, lib := range metadata.LauncherMeta.Libraries.Client {
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
pkg := tokens[len(tokens)-2]
instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)))
instanceObject.Libraries = append(instanceObject.Libraries, ProcessMavenPath(lib.Name)+"/"+ProcessMavenFilename(lib.Name))
for ind, path := range instanceObject.Libraries {
tokens := strings.Split(path, "/")
if pkg == tokens[len(tokens)-3] {
instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))
instanceObject.Libraries[ind] = ProcessMavenPath(lib.Name) + "/" + ProcessMavenFilename(lib.Name)
fmt.Printf("duplicate library %s\n", pkg)
continue client
}
@ -351,12 +351,12 @@ common:
for _, lib := range metadata.LauncherMeta.Libraries.Common {
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
pkg := tokens[len(tokens)-2]
instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)))
instanceObject.Libraries = append(instanceObject.Libraries, ProcessMavenPath(lib.Name)+"/"+ProcessMavenFilename(lib.Name))
for ind, path := range instanceObject.Libraries {
tokens := strings.Split(path, "/")
fmt.Printf("Inspecing path %s with %d tokens", path, len(tokens))
if pkg == tokens[len(tokens)-3] {
instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))
instanceObject.Libraries[ind] = ProcessMavenPath(lib.Name) + "/" + ProcessMavenFilename(lib.Name)
fmt.Printf("duplicate library %s\n", pkg)
continue common
}
@ -396,11 +396,11 @@ client:
for _, lib := range metadata.LauncherMeta.Libraries.Client {
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
pkg := tokens[len(tokens)-2]
instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)))
instanceObject.Libraries = append(instanceObject.Libraries, ProcessMavenPath(lib.Name)+"/"+ProcessMavenFilename(lib.Name))
for ind, path := range instanceObject.Libraries {
tokens := strings.Split(path, "/")
if pkg == tokens[len(tokens)-3] {
instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))
instanceObject.Libraries[ind] = ProcessMavenPath(lib.Name) + "/" + ProcessMavenFilename(lib.Name)
fmt.Printf("duplicate library %s\n", pkg)
continue client
}
@ -410,11 +410,11 @@ common:
for _, lib := range metadata.LauncherMeta.Libraries.Common {
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
pkg := tokens[len(tokens)-2]
instanceObject.Libraries = append(instanceObject.Libraries, filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name)))
instanceObject.Libraries = append(instanceObject.Libraries, ProcessMavenPath(lib.Name)+"/"+ProcessMavenFilename(lib.Name))
for ind, path := range instanceObject.Libraries {
tokens := strings.Split(path, "/")
if pkg == tokens[len(tokens)-3] {
instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))
instanceObject.Libraries[ind] = ProcessMavenPath(lib.Name) + "/" + ProcessMavenFilename(lib.Name)
fmt.Printf("duplicate library %s\n", pkg)
continue common
}
@ -462,7 +462,7 @@ outer:
for ind, path := range instanceObject.Libraries {
tokens := strings.Split(path, "/")
if pkg == tokens[len(tokens)-3] {
instanceObject.Libraries[ind] = filepath.Join(ProcessMavenPath(lib.Name), ProcessMavenFilename(lib.Name))
instanceObject.Libraries[ind] = ProcessMavenPath(lib.Name) + "/" + ProcessMavenFilename(lib.Name)
fmt.Printf("duplicate library %s\n", pkg)
continue outer
}