diff --git a/app/config.go b/app/config.go index a1b69d1..02c6453 100644 --- a/app/config.go +++ b/app/config.go @@ -129,6 +129,7 @@ func ParseConfig(filename string) (*Config, error) { Skins: &skins, WorldPath: "./", DataPath: "./", + ColorsTxtPath: "./", } info, err := os.Stat(filename) diff --git a/app/setup.go b/app/setup.go index eca8e1d..46d1d74 100644 --- a/app/setup.go +++ b/app/setup.go @@ -100,11 +100,11 @@ func Setup(p params.ParamsType, cfg *Config) *App { } //load provided colors, if available - info, err := os.Stat(filepath.Join(a.Config.DataPath, "colors.txt")) + info, err := os.Stat(filepath.Join(a.Config.ColorsTxtPath, "colors.txt")) if info != nil && err == nil { logrus.WithFields(logrus.Fields{"filename": "colors.txt"}).Info("Loading colors from filesystem") - data, err := os.ReadFile(filepath.Join(a.Config.DataPath, "colors.txt")) + data, err := os.ReadFile(filepath.Join(a.Config.ColorsTxtPath, "colors.txt")) if err != nil { panic(err) } diff --git a/app/types.go b/app/types.go index 466a259..a930a91 100644 --- a/app/types.go +++ b/app/types.go @@ -26,6 +26,7 @@ type Config struct { Skins *SkinsConfig `json:"skins"` WorldPath string `json:"worldpath"` DataPath string `json:"datapath"` + ColorsTxtPath string `json:colorstxtpath` } type MapBlockAccessorConfig struct {