From c1031c6bbef0e330826a617b2146dee2601ce191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=BCbner?= Date: Fri, 8 Sep 2023 17:04:55 +0200 Subject: [PATCH] fix the fix --- modrinth/mrpack/index.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modrinth/mrpack/index.go b/modrinth/mrpack/index.go index d6517ae..baf6e93 100644 --- a/modrinth/mrpack/index.go +++ b/modrinth/mrpack/index.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "log" "strings" ) @@ -88,8 +89,11 @@ func ReadIndex(zipFile string) (*Index, error) { } // https://github.com/modrinth/docs/issues/85 ¯\_(ツ)_/¯ - for _, file := range index.Files { - file.Path = strings.ReplaceAll(file.Path, "\\", "/") + for i, file := range index.Files { + if strings.Contains(file.Path, "\\") { + index.Files[i].Path = strings.ReplaceAll(file.Path, "\\", "/") + log.Printf("fixed file path: old=%q new=%q\n", file.Path, index.Files[i].Path) + } } return &index, nil