refactor: the grand recipe release refactor

This commit is contained in:
2021-12-21 19:25:44 +01:00
parent f57222d6aa
commit fa45264ea0
4 changed files with 288 additions and 210 deletions

View File

@ -2,20 +2,17 @@ package git
import (
"fmt"
"path"
"coopcloud.tech/abra/pkg/config"
"github.com/go-git/go-git/v5"
"github.com/sirupsen/logrus"
)
// Commit runs a git commit
func Commit(glob, commitMessage string, dryRun, push bool) error {
func Commit(repoPath, glob, commitMessage string, dryRun, push bool) error {
if commitMessage == "" {
return fmt.Errorf("no commit message specified?")
}
repoPath := path.Join(config.ABRA_DIR, "catalogue")
commitRepo, err := git.PlainOpen(repoPath)
if err != nil {
return err