diff --git a/modrinth/mrpack/index.go b/modrinth/mrpack/index.go index 161cf01..0df935a 100644 --- a/modrinth/mrpack/index.go +++ b/modrinth/mrpack/index.go @@ -7,6 +7,8 @@ import ( "fmt" "github.com/nothub/mrpack-install/web/download" "io" + "log" + "strings" ) import modrinth "github.com/nothub/mrpack-install/modrinth/api" @@ -98,6 +100,14 @@ func ReadIndex(zipFile string) (*Index, error) { return nil, err } + // https://github.com/modrinth/docs/issues/85 ¯\_(ツ)_/¯ + 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 }