0
0
mirror of https://github.com/thegeeklab/wp-git-action.git synced 2024-10-30 03:10:39 +00:00
wp-git-action/git/init.go

24 lines
384 B
Go

package git
import (
"os"
plugin_exec "github.com/thegeeklab/wp-plugin-go/v3/exec"
)
// Init creates a new Git repository in the specified directory.
func (r *Repository) Init() *plugin_exec.Cmd {
args := []string{
"init",
"-b",
r.Branch,
}
cmd := plugin_exec.Command(gitBin, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = r.WorkDir
return cmd
}