0
0
mirror of https://github.com/thegeeklab/wp-git-clone.git synced 2024-11-22 10:20:38 +00:00
wp-git-clone/git/remote.go

21 lines
337 B
Go
Raw Normal View History

2023-12-22 23:59:23 +00:00
package git
import (
"github.com/thegeeklab/wp-plugin-go/v2/types"
2023-12-22 23:59:23 +00:00
"golang.org/x/sys/execabs"
)
// RemoteAdd adds an additional remote to a git repo.
func (r *Repository) RemoteAdd() *types.Cmd {
2023-12-22 23:59:23 +00:00
args := []string{
"remote",
"add",
"origin",
r.RemoteURL,
2023-12-22 23:59:23 +00:00
}
return &types.Cmd{
Cmd: execabs.Command(gitBin, args...),
}
2023-12-22 23:59:23 +00:00
}