Skip to content

Commit

Permalink
fix the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Sep 8, 2023
1 parent 76063fc commit c1031c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modrinth/mrpack/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"log"
"strings"
)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c1031c6

Please sign in to comment.