grokkit/internal/git/helper.go

17 lines
291 B
Go

package git
import (
"os/exec"
"strings"
)
func Run(args []string) string {
out, _ := exec.Command("git", args...).Output()
return strings.TrimSpace(string(out))
}
func IsRepo() bool {
_, err := exec.Command("git", "rev-parse", "--is-inside-work-tree").Output()
return err == nil
}