0
0
mirror of https://github.com/thegeeklab/wp-git-action.git synced 2024-09-20 01:12:47 +02:00
wp-git-action/git/config.go

43 lines
661 B
Go

package git
import (
"os/exec"
"strconv"
)
// SetUserEmail sets the global git author email.
func SetUserEmail(email string) *exec.Cmd {
cmd := exec.Command(
"git",
"config",
"--local",
"user.email",
email)
return cmd
}
// SetUserName sets the global git author name.
func SetUserName(author string) *exec.Cmd {
cmd := exec.Command(
"git",
"config",
"--local",
"user.name",
author)
return cmd
}
// SetSSLSkipVerify disables globally the git ssl verification.
func SetSSLVerify(sslVerify bool) *exec.Cmd {
cmd := exec.Command(
"git",
"config",
"--local",
"http.sslVerify",
strconv.FormatBool(sslVerify))
return cmd
}