mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
refactor
This commit is contained in:
parent
3621854dc7
commit
c9a0cc6b30
30 changed files with 131 additions and 162 deletions
29
pkg/commands/git_commands/custom.go
Normal file
29
pkg/commands/git_commands/custom.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package git_commands
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
||||
"github.com/jesseduffield/lazygit/pkg/common"
|
||||
)
|
||||
|
||||
type CustomCommands struct {
|
||||
*common.Common
|
||||
|
||||
cmd oscommands.ICmdObjBuilder
|
||||
}
|
||||
|
||||
func NewCustomCommands(
|
||||
common *common.Common,
|
||||
cmd oscommands.ICmdObjBuilder,
|
||||
) *CustomCommands {
|
||||
return &CustomCommands{
|
||||
Common: common,
|
||||
cmd: cmd,
|
||||
}
|
||||
}
|
||||
|
||||
// Only to be used for the sake of running custom commands specified by the user.
|
||||
// If you want to run a new command, try finding a place for it in one of the neighbouring
|
||||
// files, or creating a new BlahCommands struct to hold it.
|
||||
func (self *CustomCommands) RunWithOutput(cmdStr string) (string, error) {
|
||||
return self.cmd.New(cmdStr).RunWithOutput()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue