Skip to content

Commit

Permalink
refactor: Handle empty currentTag and improve fetch logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenvanduocit committed Mar 29, 2023
1 parent 45ca270 commit c95e228
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,16 @@ func main() {
if autoTag {
currentTag, err := getCurrentTag()
errGuard(client, err)
if currentTag == "" {
currentTag = "v0.0.0"
}

commits, err := listCommits(currentTag)
errGuard(client, err)
nextTag := "v0.0.0"
if currentTag != "" {
commits, err := listCommits(currentTag)
fmt.Println(commits)
errGuard(client, err)

nextTag, err := getNextTag(client, commits, currentTag)
errGuard(client, err)
nextTag, err = getNextTag(client, commits, currentTag)
errGuard(client, err)
}

if err := tag(nextTag); err != nil {
errGuard(client, err)
Expand Down

0 comments on commit c95e228

Please sign in to comment.