UserConfigPath -> UserConfigDir

This commit is contained in:
Dawid Dziurla 2019-09-15 11:19:39 +02:00 committed by Jesse Duffield
parent 0d25d113c9
commit 379dcf0972
2 changed files with 24 additions and 24 deletions

View file

@ -20,7 +20,7 @@ type AppConfig struct {
Name string `long:"name" env:"NAME" default:"lazygit"`
BuildSource string `long:"build-source" env:"BUILD_SOURCE" default:""`
UserConfig *viper.Viper
UserConfigPath string
UserConfigDir string
AppState *AppState
IsNewRepo bool
}
@ -35,7 +35,7 @@ type AppConfigurer interface {
GetName() string
GetBuildSource() string
GetUserConfig() *viper.Viper
GetUserConfigPath() string
GetUserConfigDir() string
GetAppState() *AppState
WriteToUserConfig(string, string) error
SaveAppState() error
@ -63,7 +63,7 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
Debug: debuggingFlag,
BuildSource: buildSource,
UserConfig: userConfig,
UserConfigPath: userConfigPath,
UserConfigDir: filepath.Dir(userConfigPath),
AppState: &AppState{},
IsNewRepo: false,
}
@ -126,8 +126,8 @@ func (c *AppConfig) GetAppState() *AppState {
return c.AppState
}
func (c *AppConfig) GetUserConfigPath() string {
return c.UserConfigPath
func (c *AppConfig) GetUserConfigDir() string {
return c.UserConfigDir
}
func newViper(filename string) (*viper.Viper, error) {

View file

@ -260,7 +260,7 @@ func (u *Updater) downloadAndInstall(rawUrl string) error {
}
g := new(getter.HttpGetter)
configDir := filepath.Dir(u.Config.GetUserConfigPath())
configDir := u.Config.GetUserConfigDir()
u.Log.Info("Download directory is " + configDir)
// Get it!