summaryrefslogtreecommitdiffstats
path: root/pkg/app
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-03-03 12:44:10 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-03-03 12:44:10 +1100
commit8925b161a75aed3162292c2ed0e2c0135fd91a54 (patch)
tree66a69f329aec7bb87be5274f1819b6a814037acf /pkg/app
parent0a1298765c999e9dd052181295f5b32e01707bee (diff)
windows support for skipping the editor
Diffstat (limited to 'pkg/app')
-rw-r--r--pkg/app/app.go26
1 files changed, 15 insertions, 11 deletions
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()
}