Skip to content

Commit

Permalink
feat: export NextVersion()
Browse files Browse the repository at this point in the history
This makes the package importable.
  • Loading branch information
smlx committed Aug 18, 2023
1 parent d611d48 commit 71b46a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions helper_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ func walkCommits(r *git.Repository, tagRefs map[string]string, order git.LogOrde
return latestVersion, major, minor, patch, nil
}

// nextVersion returns a string containing the next version based on the state
// NextVersion returns a string containing the next version based on the state
// of the git repository in path.
func nextVersion(path string) (string, error) {
func NextVersion(path string) (string, error) {
// open repository
r, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{DetectDotGit: true})
if err != nil {
Expand Down Expand Up @@ -132,7 +132,7 @@ func main() {
if err != nil {
panic(err)
}
next, err := nextVersion(`.`)
next, err := NextVersion(`.`)
if err != nil {
log.Fatal("couldn't get next version", zap.Error(err))
}
Expand Down

0 comments on commit 71b46a8

Please sign in to comment.