mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Add option to specify additional game versions (closes #25)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
Reference in New Issue
Block a user