From 192a548c9957807d9d5c9c4700dffe02c1f55f03 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 29 Dec 2021 12:03:35 +1100 Subject: refactoring the config struct --- pkg/config/app_config.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'pkg/config') diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 7ce467335..98620ad43 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -31,18 +31,21 @@ type AppConfig struct { // from AppConfig and still be used by lazygit. type AppConfigurer interface { GetDebug() bool + + // build info GetVersion() string GetCommit() string GetBuildDate() string GetName() string GetBuildSource() string + GetUserConfig() *UserConfig GetUserConfigPaths() []string GetUserConfigDir() string + ReloadUserConfig() error + GetAppState() *AppState SaveAppState() error - ReloadUserConfig() error - ShowCommandLogOnStartup() bool } // NewAppConfig makes a new app config @@ -255,17 +258,6 @@ func (c *AppConfig) SaveAppState() error { return err } -// originally we could only hide the command log permanently via the config -// but now we do it via state. So we need to still support the config for the -// sake of backwards compatibility -func (c *AppConfig) ShowCommandLogOnStartup() bool { - if !c.UserConfig.Gui.ShowCommandLog { - return false - } - - return !c.AppState.HideCommandLog -} - // loadAppState loads recorded AppState from file func loadAppState() (*AppState, error) { filepath, err := configFilePath("state.yml") -- cgit v1.2.3