spud/git/main.go

27 lines
466 B
Go
Raw Permalink Normal View History

// Git wrapper
//
// Facilitates the usage of `git` commands when dealing with
// data living in repositories.
package git
import (
"os/exec"
)
type GitClient interface {
Clone(path string, destination string) (string, error)
}
type Git struct{}
func (g Git) Clone(path string, destination string) (string, error) {
cloneCmd := exec.Command("git", "clone", path, destination)
if err := cloneCmd.Run(); err != nil {
return "", err
}
return path, nil
}