Store your Minecraft configs with your other dotfiles, and load it automatically.
at main 516 B view raw
1package config 2 3import ( 4 "os" 5 6 "github.com/BurntSushi/toml" 7 "potassium.sh/dot-mining/minecraft" 8) 9 10type ( 11 Config struct { 12 Options minecraft.Options `toml:"options"` 13 Fabric Loader `toml:"fabric"` 14 Mods map[string]string `toml:"mods"` 15 Directory string `toml:"directory"` 16 } 17 18 Loader struct { 19 Mods map[string]string `toml:"mods"` 20 } 21) 22 23func LoadConfig() Config { 24 file, _ := os.ReadFile("config.toml") 25 var config Config 26 toml.Decode(string(file), &config) 27 return config 28}