diff options
Diffstat (limited to 'yae.go')
| -rw-r--r-- | yae.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -93,6 +93,10 @@ func main() { Name: "silent", Usage: "Silence output", }, + &cli.StringFlag{ + Name: "trim-tag-prefix", + Usage: "A prefix to trim from remote git tags", + }, }, Action: func(c *cli.Context) error { if c.Args().Len() != 2 { @@ -124,6 +128,10 @@ func main() { source.TagPredicate = c.String("tag-predicate") } + if c.String("trim-tag-prefix") != "" { + source.TrimTagPrefix = c.String("trim-tag-prefix") + } + if sha256, err := fetchSHA256(source.URI, c.Bool("unpack"), !c.Bool("silent")); err != nil { return err } else { @@ -273,6 +281,10 @@ func fetchLatestGitTag(source Source, show bool) (string, error) { } } + if source.TrimTagPrefix != "" { + latest = strings.TrimPrefix(latest, source.TrimTagPrefix) + } + return latest, nil } |