mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
updating specs
This commit is contained in:
parent
1fc0d786ae
commit
b028f37ba8
15 changed files with 416 additions and 241 deletions
|
@ -17,27 +17,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
// Platform stores the os state
|
||||
type Platform struct {
|
||||
OS string
|
||||
Shell string
|
||||
ShellArg string
|
||||
OpenCommand string
|
||||
OpenLinkCommand string
|
||||
}
|
||||
|
||||
type ICommander interface {
|
||||
Run(ICmdObj) error
|
||||
RunWithOutput(ICmdObj) (string, error)
|
||||
}
|
||||
|
||||
type RealCommander struct {
|
||||
}
|
||||
|
||||
func (self *RealCommander) Run(cmdObj ICmdObj) error {
|
||||
return cmdObj.GetCmd().Run()
|
||||
}
|
||||
|
||||
// OSCommand holds all the os commands
|
||||
type OSCommand struct {
|
||||
*common.Common
|
||||
|
@ -56,6 +35,15 @@ type OSCommand struct {
|
|||
Cmd *CmdObjBuilder
|
||||
}
|
||||
|
||||
// Platform stores the os state
|
||||
type Platform struct {
|
||||
OS string
|
||||
Shell string
|
||||
ShellArg string
|
||||
OpenCommand string
|
||||
OpenLinkCommand string
|
||||
}
|
||||
|
||||
// TODO: make these fields private
|
||||
type CmdLogEntry struct {
|
||||
// e.g. 'git commit -m "haha"'
|
||||
|
@ -99,7 +87,7 @@ func NewOSCommand(common *common.Common) *OSCommand {
|
|||
removeFile: os.RemoveAll,
|
||||
}
|
||||
|
||||
runner := &Runner{log: common.Log, logCmdObj: c.LogCmdObj}
|
||||
runner := &cmdObjRunner{log: common.Log, logCmdObj: c.LogCmdObj}
|
||||
c.Cmd = &CmdObjBuilder{runner: runner, command: command, logCmdObj: c.LogCmdObj, platform: platform}
|
||||
|
||||
return c
|
||||
|
@ -117,7 +105,7 @@ func (c *OSCommand) WithSpan(span string) *OSCommand {
|
|||
*newOSCommand = *c
|
||||
newOSCommand.CmdLogSpan = span
|
||||
newOSCommand.Cmd.logCmdObj = newOSCommand.LogCmdObj
|
||||
newOSCommand.Cmd.runner = &Runner{log: c.Log, logCmdObj: newOSCommand.LogCmdObj}
|
||||
newOSCommand.Cmd.runner = &cmdObjRunner{log: c.Log, logCmdObj: newOSCommand.LogCmdObj}
|
||||
return newOSCommand
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue