1
0

19 lines
316 B
Go
Raw Normal View History

2025-01-01 20:52:09 +01:00
package utils
import (
"errors"
"os/exec"
"strings"
)
2025-01-01 20:52:09 +01:00
func GitUserData(key string) (string, error) {
cmd := exec.Command("git", "config", "--get", key)
out, err := cmd.Output()
if err != nil {
return "", errors.New("can't read Git config")
}
value := strings.TrimSpace(string(out))
return value, nil
}