mirror of
https://github.com/thegeeklab/wp-git-action.git
synced 2024-11-10 03:20:40 +00:00
23 lines
359 B
Go
23 lines
359 B
Go
package git
|
|
|
|
import (
|
|
"github.com/thegeeklab/wp-plugin-go/v2/types"
|
|
"golang.org/x/sys/execabs"
|
|
)
|
|
|
|
// Init creates a new Git repository in the specified directory.
|
|
func (r *Repository) Init() *types.Cmd {
|
|
args := []string{
|
|
"init",
|
|
"-b",
|
|
r.Branch,
|
|
}
|
|
|
|
cmd := &types.Cmd{
|
|
Cmd: execabs.Command(gitBin, args...),
|
|
}
|
|
cmd.Dir = r.WorkDir
|
|
|
|
return cmd
|
|
}
|