Import author/version metadata from CurseForge packs

This commit is contained in:
comp500 2022-02-10 16:32:55 +00:00
parent f41235b04c
commit 226a376be9
4 changed files with 21 additions and 2 deletions

View File

@ -155,7 +155,8 @@ var importCmd = &cobra.Command{
pack = core.Pack{
Name: packImport.Name(),
// TODO: author, version?
Author: packImport.PackAuthor(),
Version: packImport.PackVersion(),
PackFormat: core.CurrentPackFormat,
Index: struct {
File string `toml:"file"`

View File

@ -9,6 +9,8 @@ type ImportPackFile interface {
type ImportPackMetadata interface {
Name() string
PackAuthor() string
PackVersion() string
Versions() map[string]string
Mods() []AddonFileReference
GetFiles() ([]ImportPackFile, error)

View File

@ -31,6 +31,14 @@ func (c cursePackMeta) Name() string {
return c.NameInternal
}
func (c cursePackMeta) PackVersion() string {
return c.Version
}
func (c cursePackMeta) PackAuthor() string {
return c.Author
}
func (c cursePackMeta) Versions() map[string]string {
vers := make(map[string]string)
vers["minecraft"] = c.Minecraft.Version

View File

@ -34,6 +34,14 @@ func (m twitchInstalledPackMeta) Name() string {
return m.NameInternal
}
func (m twitchInstalledPackMeta) PackAuthor() string {
return ""
}
func (m twitchInstalledPackMeta) PackVersion() string {
return ""
}
func (m twitchInstalledPackMeta) Versions() map[string]string {
vers := make(map[string]string)
vers["minecraft"] = m.MCVersion