2022-01-08 05:00:36 +02:00
|
|
|
package git_commands
|
2022-01-07 11:33:34 +02:00
|
|
|
|
2023-05-21 09:00:29 +02:00
|
|
|
import "github.com/mgutz/str"
|
|
|
|
|
2022-01-07 11:33:34 +02:00
|
|
|
type CustomCommands struct {
|
2022-01-18 12:26:21 +02:00
|
|
|
*GitCommon
|
2022-01-07 11:33:34 +02:00
|
|
|
}
|
|
|
|
|
2022-01-18 12:26:21 +02:00
|
|
|
func NewCustomCommands(gitCommon *GitCommon) *CustomCommands {
|
2022-01-07 11:33:34 +02:00
|
|
|
return &CustomCommands{
|
2022-01-18 12:26:21 +02:00
|
|
|
GitCommon: gitCommon,
|
2022-01-07 11:33:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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) {
|
2023-05-21 09:00:29 +02:00
|
|
|
return self.cmd.New(str.ToArgv(cmdStr)).RunWithOutput()
|
2022-01-07 11:33:34 +02:00
|
|
|
}
|