From 8925b161a75aed3162292c2ed0e2c0135fd91a54 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 3 Mar 2019 12:44:10 +1100 Subject: windows support for skipping the editor --- pkg/app/app.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'pkg/app') diff --git a/pkg/app/app.go b/pkg/app/app.go index a8d0a1045..4c895f521 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -22,14 +22,14 @@ import ( type App struct { closers []io.Closer - Config config.AppConfigurer - Log *logrus.Entry - OSCommand *commands.OSCommand - GitCommand *commands.GitCommand - Gui *gui.Gui - Tr *i18n.Localizer - Updater *updates.Updater // may only need this on the Gui - DemonContext string + Config config.AppConfigurer + Log *logrus.Entry + OSCommand *commands.OSCommand + GitCommand *commands.GitCommand + Gui *gui.Gui + Tr *i18n.Localizer + Updater *updates.Updater // may only need this on the Gui + ClientContext string } func newProductionLogger(config config.AppConfigurer) *logrus.Logger { @@ -92,8 +92,8 @@ func NewApp(config config.AppConfigurer) (*App, error) { app.Tr = i18n.NewLocalizer(app.Log) // if we are being called in 'demon' mode, we can just return here - app.DemonContext = os.Getenv("LAZYGIT_CONTEXT") - if app.DemonContext != "" { + app.ClientContext = os.Getenv("LAZYGIT_CLIENT_COMMAND") + if app.ClientContext != "" { return app, nil } @@ -119,10 +119,14 @@ func NewApp(config config.AppConfigurer) (*App, error) { } func (app *App) Run() error { - if app.DemonContext == "INTERACTIVE_REBASE" { + if app.ClientContext == "INTERACTIVE_REBASE" { return app.Rebase() } + if app.ClientContext == "EXIT_IMMEDIATELY" { + os.Exit(0) + } + return app.Gui.RunWithSubprocesses() } -- cgit v1.2.3