Add option to specify additional game versions (closes #25)

This commit is contained in:
comp500
2021-05-04 19:07:29 +01:00
parent 6557719c1f
commit 7bedd820c2
6 changed files with 76 additions and 11 deletions

View File

@@ -26,6 +26,7 @@ type Pack struct {
Client map[string]toml.Primitive `toml:"client"`
Server map[string]toml.Primitive `toml:"server"`
Export map[string]map[string]interface{} `toml:"export"`
Options map[string]interface{} `toml:"options"`
}
// LoadPack loads the modpack metadata to a Pack struct
@@ -35,6 +36,14 @@ func LoadPack() (Pack, error) {
return Pack{}, err
}
// Read options into viper
if modpack.Options != nil {
err := viper.MergeConfigMap(modpack.Options)
if err != nil {
return Pack{}, err
}
}
if len(modpack.Index.File) == 0 {
modpack.Index.File = "index.toml"
}