mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-16 11:37:01 +02:00
32 lines
756 B
Go
32 lines
756 B
Go
package oscommands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
|
)
|
|
|
|
// NewDummyOSCommand creates a new dummy OSCommand for testing
|
|
func NewDummyOSCommand() *OSCommand {
|
|
return NewOSCommand(utils.NewDummyCommon())
|
|
}
|
|
|
|
func NewDummyCmdObjBuilder(runner ICmdObjRunner) *CmdObjBuilder {
|
|
return &CmdObjBuilder{
|
|
runner: runner,
|
|
logCmdObj: func(ICmdObj) {},
|
|
platform: &Platform{
|
|
OS: "darwin",
|
|
Shell: "bash",
|
|
ShellArg: "-c",
|
|
OpenCommand: "open {{filename}}",
|
|
OpenLinkCommand: "open {{link}}",
|
|
},
|
|
}
|
|
}
|
|
|
|
func NewDummyOSCommandWithRunner(runner *FakeCmdObjRunner) *OSCommand {
|
|
osCommand := NewOSCommand(utils.NewDummyCommon())
|
|
osCommand.Cmd = NewDummyCmdObjBuilder(runner)
|
|
|
|
return osCommand
|
|
}
|