summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-12-30 10:43:46 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-12-30 10:44:08 +1100
commitd8084cd558925eb7c9c38afeed5725c21653ab90 (patch)
tree8467867fc0998df30df799336e65ac142dd61045 /pkg/gui
parent65f910ebd85283b5cce9bf67d03d3f1a9ea3813a (diff)
WIP
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/custom_commands.go4
-rw-r--r--pkg/gui/diffing.go2
-rw-r--r--pkg/gui/files_panel.go6
-rw-r--r--pkg/gui/git_flow.go6
-rw-r--r--pkg/gui/gpg.go4
-rw-r--r--pkg/gui/rebase_options_panel.go2
-rw-r--r--pkg/gui/recent_repos_panel.go2
-rw-r--r--pkg/gui/stash_panel.go2
8 files changed, 14 insertions, 14 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index e5de5fb6a..60d7f806c 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -203,7 +203,7 @@ func (gui *Gui) menuPromptFromCommand(prompt config.CustomCommandPrompt, promptR
}
// Run and save output
- message, err := gui.GitCommand.NewCmdObj(cmdStr).RunWithOutput()
+ message, err := gui.GitCommand.Cmd.New(cmdStr).RunWithOutput()
if err != nil {
return gui.surfaceError(err)
}
@@ -252,7 +252,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand config.CustomCommand
loadingText = gui.Tr.LcRunningCustomCommandStatus
}
return gui.WithWaitingStatus(loadingText, func() error {
- err := gui.OSCommand.WithSpan(gui.Tr.Spans.CustomCommand).NewShellCmdObj(cmdStr).Run()
+ err := gui.OSCommand.WithSpan(gui.Tr.Spans.CustomCommand).Cmd.NewShell(cmdStr).Run()
if err != nil {
return gui.surfaceError(err)
}
diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go
index 8b54e21af..e3b888066 100644
--- a/pkg/gui/diffing.go
+++ b/pkg/gui/diffing.go
@@ -13,7 +13,7 @@ func (gui *Gui) exitDiffMode() error {
}
func (gui *Gui) renderDiff() error {
- cmdObj := gui.OSCommand.NewCmdObj(
+ cmdObj := gui.OSCommand.Cmd.New(
fmt.Sprintf("git diff --submodule --no-ext-diff --color %s", gui.diffStr()),
)
task := NewRunPtyTask(cmdObj.GetCmd())
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index b5c387c81..f1ac1d1a5 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -465,7 +465,7 @@ func (gui *Gui) handleCommitEditorPress() error {
cmdStr := "git " + strings.Join(args, " ")
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.GitCommand.WithSpan(gui.Tr.Spans.Commit).NewCmdObj(cmdStr).Log(),
+ gui.GitCommand.WithSpan(gui.Tr.Spans.Commit).Cmd.New(cmdStr).Log(),
)
}
@@ -511,7 +511,7 @@ func (gui *Gui) editFileAtLine(filename string, lineNumber int) error {
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan(gui.Tr.Spans.EditFile).NewShellCmdObj(cmdStr),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.EditFile).Cmd.NewShell(cmdStr),
)
}
@@ -923,7 +923,7 @@ func (gui *Gui) handleCustomCommand() error {
gui.OnRunCommand(oscommands.NewCmdLogEntry(command, gui.Tr.Spans.CustomCommand, true))
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.NewShellCmdObj(command),
+ gui.OSCommand.Cmd.NewShell(command),
)
},
})
diff --git a/pkg/gui/git_flow.go b/pkg/gui/git_flow.go
index 14676e4b2..3c8066527 100644
--- a/pkg/gui/git_flow.go
+++ b/pkg/gui/git_flow.go
@@ -32,7 +32,7 @@ func (gui *Gui) gitFlowFinishBranch(gitFlowConfig string, branchName string) err
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.GitCommand.WithSpan(gui.Tr.Spans.GitFlowFinish).NewCmdObj("git flow " + branchType + " finish " + suffix).Log(),
+ gui.GitCommand.WithSpan(gui.Tr.Spans.GitFlowFinish).Cmd.New("git flow " + branchType + " finish " + suffix).Log(),
)
}
@@ -43,7 +43,7 @@ func (gui *Gui) handleCreateGitFlowMenu() error {
}
// get config
- gitFlowConfig, err := gui.GitCommand.NewCmdObj("git config --local --get-regexp gitflow").RunWithOutput()
+ gitFlowConfig, err := gui.GitCommand.Cmd.New("git config --local --get-regexp gitflow").RunWithOutput()
if err != nil {
return gui.createErrorPanel("You need to install git-flow and enable it in this repo to use git-flow features")
}
@@ -56,7 +56,7 @@ func (gui *Gui) handleCreateGitFlowMenu() error {
title: title,
handleConfirm: func(name string) error {
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.GitCommand.WithSpan(gui.Tr.Spans.GitFlowStart).NewCmdObj("git flow " + branchType + " start " + name).Log(),
+ gui.GitCommand.WithSpan(gui.Tr.Spans.GitFlowStart).Cmd.New("git flow " + branchType + " start " + name).Log(),
)
},
})
diff --git a/pkg/gui/gpg.go b/pkg/gui/gpg.go
index a757871a1..fe40f8cb8 100644
--- a/pkg/gui/gpg.go
+++ b/pkg/gui/gpg.go
@@ -15,7 +15,7 @@ import (
func (gui *Gui) withGpgHandling(cmdObj oscommands.ICmdObj, waitingStatus string, onSuccess func() error) error {
useSubprocess := gui.GitCommand.UsingGpg()
if useSubprocess {
- success, err := gui.runSubprocessWithSuspense(gui.OSCommand.NewShellCmdObj(cmdObj.ToString()))
+ success, err := gui.runSubprocessWithSuspense(gui.OSCommand.Cmd.NewShell(cmdObj.ToString()))
if success && onSuccess != nil {
if err := onSuccess(); err != nil {
return err
@@ -33,7 +33,7 @@ func (gui *Gui) withGpgHandling(cmdObj oscommands.ICmdObj, waitingStatus string,
func (gui *Gui) RunAndStream(cmdObj oscommands.ICmdObj, waitingStatus string, onSuccess func() error) error {
return gui.WithWaitingStatus(waitingStatus, func() error {
- cmdObj := gui.OSCommand.NewShellCmdObj(cmdObj.ToString())
+ cmdObj := gui.OSCommand.Cmd.NewShell(cmdObj.ToString())
cmdObj.AddEnvVars("TERM=dumb")
cmdWriter := gui.getCmdWriter()
cmd := cmdObj.GetCmd()
diff --git a/pkg/gui/rebase_options_panel.go b/pkg/gui/rebase_options_panel.go
index 90108258e..205b9df92 100644
--- a/pkg/gui/rebase_options_panel.go
+++ b/pkg/gui/rebase_options_panel.go
@@ -58,7 +58,7 @@ func (gui *Gui) genericMergeCommand(command string) error {
// it's impossible for a rebase to require a commit so we'll use a subprocess only if it's a merge
if status == commands.REBASE_MODE_MERGING && command != REBASE_OPTION_ABORT && gui.UserConfig.Git.Merging.ManualCommit {
- sub := gitCommand.NewCmdObj("git " + commandType + " --" + command)
+ sub := gitCommand.Cmd.New("git " + commandType + " --" + command)
if sub != nil {
return gui.runSubprocessWithSuspenseAndRefresh(sub)
}
diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go
index 64f99c611..5a7c58edb 100644
--- a/pkg/gui/recent_repos_panel.go
+++ b/pkg/gui/recent_repos_panel.go
@@ -38,7 +38,7 @@ func (gui *Gui) handleCreateRecentReposMenu() error {
}
func (gui *Gui) handleShowAllBranchLogs() error {
- cmdObj := gui.OSCommand.NewCmdObj(
+ cmdObj := gui.OSCommand.Cmd.New(
gui.UserConfig.Git.AllBranchesLogCmd,
)
task := NewRunPtyTask(cmdObj.GetCmd())
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go
index 3064b5a62..1f23ccc37 100644
--- a/pkg/gui/stash_panel.go
+++ b/pkg/gui/stash_panel.go
@@ -22,7 +22,7 @@ func (gui *Gui) stashRenderToMain() error {
if stashEntry == nil {
task = NewRenderStringTask(gui.Tr.NoStashEntries)
} else {
- cmdObj := gui.OSCommand.NewCmdObj(
+ cmdObj := gui.OSCommand.Cmd.New(
gui.GitCommand.ShowStashEntryCmdStr(stashEntry.Index),
)
task = NewRunPtyTask(cmdObj.GetCmd())