Skip to content

Commit

Permalink
path separator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Sep 8, 2023
1 parent 9942ab3 commit 9c62999
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modrinth/mrpack/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 9c62999

Please sign in to comment.