mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
27 lines
425 B
Go
27 lines
425 B
Go
|
package apigen
|
||
|
|
||
|
import (
|
||
|
"os/exec"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
func getGitName() string {
|
||
|
cmd := exec.Command("git", "config", "user.name")
|
||
|
out, err := cmd.CombinedOutput()
|
||
|
if err != nil {
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
return strings.TrimSpace(string(out))
|
||
|
}
|
||
|
|
||
|
func getGitEmail() string {
|
||
|
cmd := exec.Command("git", "config", "user.email")
|
||
|
out, err := cmd.CombinedOutput()
|
||
|
if err != nil {
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
return strings.TrimSpace(string(out))
|
||
|
}
|