mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-18 20:46:30 +02:00
fix: map modinfos by id (#152)
* fix: map modinfos by id * chore: undo autoformat * chore: restore formatting
This commit is contained in:
parent
f79de590d9
commit
89f189256e
@ -90,10 +90,14 @@ var detectCmd = &cobra.Command{
|
||||
fmt.Printf("Failed to retrieve metadata: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
modInfosMap := make(map[uint32]modInfo)
|
||||
for _, v := range modInfos {
|
||||
modInfosMap[v.ID] = v
|
||||
}
|
||||
|
||||
fmt.Println("Creating metadata files...")
|
||||
for i, v := range res.ExactMatches {
|
||||
err = createModFile(modInfos[i], v.File, &index, false)
|
||||
for _, v := range res.ExactMatches {
|
||||
err = createModFile(modInfosMap[v.ID], v.File, &index, false)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user