diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 19:10:57 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 20:48:49 +1000 |
commit | 1759ddf2470389d8de7ccedad24caf66c3cdb7d5 (patch) | |
tree | 728215e1a6a2e60580ac905b1709f67a38f1814c /pkg/gui | |
parent | f9643448a4ba186fb56d408a5ee8a21193986cd6 (diff) |
move OS commands into their own package
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/gui.go | 5 | ||||
-rw-r--r-- | pkg/gui/reset_menu_panel.go | 6 | ||||
-rw-r--r-- | pkg/gui/undoing.go | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 6dc3bf12c..8c85a468f 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -22,6 +22,7 @@ import ( "github.com/golang-collections/collections/stack" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/commands/patch" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/i18n" @@ -90,7 +91,7 @@ type Gui struct { g *gocui.Gui Log *logrus.Entry GitCommand *commands.GitCommand - OSCommand *commands.OSCommand + OSCommand *oscommands.OSCommand SubProcess *exec.Cmd State *guiState Config config.AppConfigurer @@ -384,7 +385,7 @@ func (gui *Gui) resetState() { // for now the split view will always be on // NewGui builds a new gui handler -func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater, filterPath string, showRecentRepos bool) (*Gui, error) { +func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscommands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater, filterPath string, showRecentRepos bool) (*Gui, error) { gui := &Gui{ Log: log, GitCommand: gitCommand, diff --git a/pkg/gui/reset_menu_panel.go b/pkg/gui/reset_menu_panel.go index e75c20aad..26b3cb427 100644 --- a/pkg/gui/reset_menu_panel.go +++ b/pkg/gui/reset_menu_panel.go @@ -4,10 +4,10 @@ import ( "fmt" "github.com/fatih/color" - "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) -func (gui *Gui) resetToRef(ref string, strength string, options commands.RunCommandOptions) error { +func (gui *Gui) resetToRef(ref string, strength string, options oscommands.RunCommandOptions) error { if err := gui.GitCommand.ResetToCommit(ref, strength, options); err != nil { return gui.surfaceError(err) } @@ -41,7 +41,7 @@ func (gui *Gui) createResetMenu(ref string) error { ), }, onPress: func() error { - return gui.resetToRef(ref, strength, commands.RunCommandOptions{}) + return gui.resetToRef(ref, strength, oscommands.RunCommandOptions{}) }, } } diff --git a/pkg/gui/undoing.go b/pkg/gui/undoing.go index 2224c2b1f..d6f7c99e2 100644 --- a/pkg/gui/undoing.go +++ b/pkg/gui/undoing.go @@ -2,7 +2,7 @@ package gui import ( "github.com/jesseduffield/gocui" - "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -156,7 +156,7 @@ type handleHardResetWithAutoStashOptions struct { // only to be used in the undo flow for now func (gui *Gui) handleHardResetWithAutoStash(commitSha string, options handleHardResetWithAutoStashOptions) error { reset := func() error { - if err := gui.resetToRef(commitSha, "hard", commands.RunCommandOptions{EnvVars: options.EnvVars}); err != nil { + if err := gui.resetToRef(commitSha, "hard", oscommands.RunCommandOptions{EnvVars: options.EnvVars}); err != nil { return gui.surfaceError(err) } return nil |