fix path splitting issue
This commit is contained in:
parent
40311e1b12
commit
cddb8bb478
@ -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), string(os.PathSeparator))
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
|
||||
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)
|
||||
@ -349,11 +349,11 @@ client:
|
||||
}
|
||||
common:
|
||||
for _, lib := range metadata.LauncherMeta.Libraries.Common {
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator))
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
|
||||
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)
|
||||
@ -393,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), string(os.PathSeparator))
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
|
||||
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)
|
||||
@ -407,11 +407,11 @@ client:
|
||||
}
|
||||
common:
|
||||
for _, lib := range metadata.LauncherMeta.Libraries.Common {
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), string(os.PathSeparator))
|
||||
tokens := strings.Split(ProcessMavenPath(lib.Name), "/")
|
||||
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)
|
||||
@ -455,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, string(os.PathSeparator))
|
||||
tokens := strings.Split(lib.Downloads.Artifact.Path, "/")
|
||||
pkg := tokens[len(tokens)-2]
|
||||
instanceObject.Libraries = append(instanceObject.Libraries, lib.Downloads.Artifact.Path)
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user