Skip to content

Commit

Permalink
use helper for lsat tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhuravlev committed Nov 29, 2023
1 parent 351dbbf commit 03313fd
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions cmd/gt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {
{
Name: "last",
Aliases: []string{"l"},
Action: cmdTagGetSemverLast,
Action: withManager(cmdTagGetSemverLast),
Usage: "show last semver tag",
},
},
Expand Down Expand Up @@ -112,17 +112,7 @@ func buildTagIncrementor(component repomanager.Component) func(ctx *cli.Context)
}
}

func cmdTagGetSemverLast(c *cli.Context) error {
repoPath := c.String(flagRepoPath)
if repoPath == "" {
return errors.New("path to repo must be set by flag " + flagRepoPath)
}

m, err := repomanager.New(repoPath)
if err != nil {
return fmt.Errorf("cannot build repo manager: %w", err)
}

func cmdTagGetSemverLast(c *cli.Context, m *repomanager.Manager) error {
maxTag, err := m.GetTagsSemverMax()
if err != nil {
return fmt.Errorf("cannot get max tag: %w", err)
Expand Down

0 comments on commit 03313fd

Please sign in to comment.