2023-12-22 23:59:23 +00:00
|
|
|
package git
|
|
|
|
|
|
|
|
import (
|
2024-05-17 19:50:05 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
plugin_exec "github.com/thegeeklab/wp-plugin-go/v3/exec"
|
2023-12-22 23:59:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// RemoteAdd adds an additional remote to a git repo.
|
2024-05-17 19:50:05 +00:00
|
|
|
func (r *Repository) RemoteAdd() *plugin_exec.Cmd {
|
2023-12-22 23:59:23 +00:00
|
|
|
args := []string{
|
|
|
|
"remote",
|
|
|
|
"add",
|
|
|
|
"origin",
|
2024-05-06 18:30:18 +00:00
|
|
|
r.RemoteURL,
|
2023-12-22 23:59:23 +00:00
|
|
|
}
|
|
|
|
|
2024-05-17 19:50:05 +00:00
|
|
|
cmd := plugin_exec.Command(gitBin, args...)
|
|
|
|
cmd.Stdout = os.Stdout
|
|
|
|
cmd.Stderr = os.Stderr
|
|
|
|
|
|
|
|
return cmd
|
2023-12-22 23:59:23 +00:00
|
|
|
}
|