Example #1
0
func (r *GitRepository) Clone(url string) error {
	if !disk.IsDir(r.path) {
		os.MkdirAll(r.path, 0777)
	}

	cmd := exec.Command("git", "clone", url, r.path)
	cmd.Dir = r.path
	if out, err := cmd.CombinedOutput(); err != nil {
		return fmt.Errorf(string(out), err)
	}

	return nil
}
Example #2
0
func (fs *Filespace) IsDir(subPath string) bool {
	return disk.IsDir(fs.path + subPath)
}