forked from toolshed/abra
feat: abra release now asks for a release note (!393)
This implements coop-cloud/organising#540 by checking if a`release/next` file exists and if so moves it to `release/<tag>`. When no release notes exists it prompts for them. Reviewed-on: coop-cloud/abra#393 Reviewed-by: moritz <moritz.m@local-it.org> Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
This commit is contained in:
27
pkg/git/add.go
Normal file
27
pkg/git/add.go
Normal file
@ -0,0 +1,27 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Add adds a file to the git index.
|
||||
func Add(repoPath, path string, dryRun bool) error {
|
||||
repo, err := git.PlainOpen(repoPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
worktree, err := repo.Worktree()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dryRun {
|
||||
logrus.Debugf("dry run: adding %s", path)
|
||||
} else {
|
||||
worktree.Add(path)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user