2024-12-29 05:49:26 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
func gitUserData(key string) (string, error) {
|
|
|
|
cmd := exec.Command("git", "config", "--get", key)
|
|
|
|
out, err := cmd.Output()
|
|
|
|
if err != nil {
|
2024-12-29 05:51:16 +01:00
|
|
|
return "", errors.New("can't read Git config")
|
2024-12-29 05:49:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
value := strings.TrimSpace(string(out))
|
|
|
|
return value, nil
|
|
|
|
}
|