示例#1
0
文件: git.go 项目: e8vm/shanhu
// GitPull runs "git pull origin master" in the repository
func GitPull(path string) error {
	srcPath, err := repoSrcPath(path)
	if err != nil {
		return err
	}

	return git.Pull(srcPath)
}
示例#2
0
文件: repo.go 项目: e8vm/shanhu
// UpdateDB syncs the repository and updates it in the database.
func UpdateDB(db repodb.DB, src, path string) []error {
	if err := git.Pull(src); err != nil {
		return []error{fmt.Errorf("git pull: %s", err)}
	}

	b, errs := Build(src, path)
	if len(errs) > 0 {
		return errs
	}

	if err := db.AddBuild(b); err != nil {
		return []error{err}
	}
	return nil
}