mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Fix mod URLs in modlist.html export
This commit is contained in:
parent
14d93fbd4e
commit
bd9f5dbebc
@ -5,12 +5,10 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/comp500/packwiz/curseforge/packinterop"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/comp500/packwiz/curseforge/packinterop"
|
|
||||||
|
|
||||||
"github.com/comp500/packwiz/core"
|
"github.com/comp500/packwiz/core"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -310,8 +308,16 @@ func createModlist(zw *zip.Writer, mods []core.Mod) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
project := projectRaw.(cfUpdateData)
|
project := projectRaw.(cfUpdateData)
|
||||||
projIDString := strconv.Itoa(project.ProjectID)
|
// TODO: store this in the metadata
|
||||||
_, err = w.WriteString("<li><a href=\"https://minecraft.curseforge.com/mc-mods/" + projIDString + "\">" + mod.Name + "</a></li>\r\n")
|
modInfo, err := getModInfo(project.ProjectID)
|
||||||
|
if err != nil {
|
||||||
|
_, err = w.WriteString("<li>" + mod.Name + "</li>\r\n")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_, err = w.WriteString("<li><a href=\"" + modInfo.WebsiteURL + "\">" + mod.Name + "</a></li>\r\n")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ const (
|
|||||||
type modInfo struct {
|
type modInfo struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
|
WebsiteURL string `json:"websiteUrl"`
|
||||||
ID int `json:"id"`
|
ID int `json:"id"`
|
||||||
LatestFiles []modFileInfo `json:"latestFiles"`
|
LatestFiles []modFileInfo `json:"latestFiles"`
|
||||||
GameVersionLatestFiles []struct {
|
GameVersionLatestFiles []struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user