1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

WIP auto updates

This commit is contained in:
Jesse Duffield
2018-08-19 23:28:29 +10:00
parent 1e44001910
commit d938a437a2
3 changed files with 205 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui"
"github.com/jesseduffield/lazygit/pkg/i18n"
"github.com/jesseduffield/lazygit/pkg/updates"
)
// App struct
@@ -22,6 +23,7 @@ type App struct {
GitCommand *commands.GitCommand
Gui *gui.Gui
Tr *i18n.Localizer
Updater *updates.Updater // may only need this on the Gui
}
func newLogger(config config.AppConfigurer) *logrus.Logger {
@@ -60,7 +62,11 @@ func NewApp(config config.AppConfigurer) (*App, error) {
if err != nil {
return app, err
}
app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config)
app.Updater, err = updates.NewUpdater(app.Log, config, app.OSCommand)
if err != nil {
return app, err
}
app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config, app.Updater)
if err != nil {
return app, err
}