示例#1
0
文件: git.go 项目: goatcms/goat-core
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
}
示例#2
0
func (fs *Filespace) IsDir(subPath string) bool {
	return disk.IsDir(fs.path + subPath)
}