1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

improve version regex

This commit is contained in:
Carlos Alexandro Becker 2017-01-30 10:01:05 -02:00
parent 1c2221b2c5
commit a444a4ef53
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -46,7 +46,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
}
// removes usual `v` prefix
ctx.Version = strings.TrimPrefix(tag, "v")
if matches, err := regexp.MatchString("[0-9.]+", ctx.Version); !matches || err != nil {
if matches, err := regexp.MatchString("^[0-9.]+", ctx.Version); !matches || err != nil {
return ErrInvalidVersionFormat{ctx.Version}
}
return