No need to export SimpleExec
This commit is contained in:
parent
cffa7d3de8
commit
fc9768b684
@ -7,27 +7,27 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Find(val string) string {
|
func Find(val string) string {
|
||||||
output, _ := SimpleExec("git", "config", val)
|
output, _ := simpleExec("git", "config", val)
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetGlobal(key, val string) {
|
func SetGlobal(key, val string) {
|
||||||
SimpleExec("git", "config", "--global", "--add", key, val)
|
simpleExec("git", "config", "--global", "--add", key, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
func UnsetGlobal(key string) {
|
func UnsetGlobal(key string) {
|
||||||
SimpleExec("git", "config", "--global", "--unset", key)
|
simpleExec("git", "config", "--global", "--unset", key)
|
||||||
}
|
}
|
||||||
|
|
||||||
func List() (string, error) {
|
func List() (string, error) {
|
||||||
return SimpleExec("git", "config", "-l")
|
return simpleExec("git", "config", "-l")
|
||||||
}
|
}
|
||||||
|
|
||||||
func ListFromFile() (string, error) {
|
func ListFromFile() (string, error) {
|
||||||
return SimpleExec("git", "config", "-l", "-f", ".gitconfig")
|
return simpleExec("git", "config", "-l", "-f", ".gitconfig")
|
||||||
}
|
}
|
||||||
|
|
||||||
func SimpleExec(name string, arg ...string) (string, error) {
|
func simpleExec(name string, arg ...string) (string, error) {
|
||||||
output, err := exec.Command(name, arg...).Output()
|
output, err := exec.Command(name, arg...).Output()
|
||||||
if _, ok := err.(*exec.ExitError); ok {
|
if _, ok := err.(*exec.ExitError); ok {
|
||||||
return "", nil
|
return "", nil
|
||||||
|
Loading…
Reference in New Issue
Block a user