mirror of
https://github.com/thegeeklab/wp-git-action.git
synced 2024-09-20 01:12:47 +02:00
20 lines
315 B
Go
20 lines
315 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 Init(repo Repository) *types.Cmd {
|
|
cmd := execabs.Command(
|
|
gitBin,
|
|
"init",
|
|
)
|
|
cmd.Dir = repo.WorkDir
|
|
|
|
return &types.Cmd{
|
|
Cmd: cmd,
|
|
}
|
|
}
|