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
Raw Normal View History

2022-11-27 14:33:39 +01:00
package git
2019-06-07 12:32:16 +02:00
import (
"os/exec"
"strconv"
2019-06-07 12:32:16 +02:00
)
// SetUserEmail sets the global git author email.
func SetUserEmail(email string) *exec.Cmd {
2019-06-07 12:32:16 +02:00
cmd := exec.Command(
"git",
"config",
"--local",
2019-06-07 12:32:16 +02:00
"user.email",
email)
return cmd
}
// SetUserName sets the global git author name.
func SetUserName(author string) *exec.Cmd {
2019-06-07 12:32:16 +02:00
cmd := exec.Command(
"git",
"config",
"--local",
2019-06-07 12:32:16 +02:00
"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
}