diff --git a/pkg/config-reader/reader.go b/pkg/config-reader/reader.go index 73b9d718d..0f3e2c1d9 100644 --- a/pkg/config-reader/reader.go +++ b/pkg/config-reader/reader.go @@ -107,7 +107,7 @@ func (r *ConfigReader) readPackage(logE *logrus.Entry, configFilePath string, pk "version_expr": pkg.VersionExpr, })) } - pkg.Version = s + pkg.Version = pkg.VersionExprPrefix + s return nil, nil } if pkg.Import == "" { diff --git a/pkg/config/aqua/config.go b/pkg/config/aqua/config.go index 69c184f74..df05357f5 100644 --- a/pkg/config/aqua/config.go +++ b/pkg/config/aqua/config.go @@ -7,19 +7,20 @@ import ( ) type Package struct { - Name string `validate:"required" json:"name,omitempty"` - Registry string `validate:"required" yaml:",omitempty" json:"registry,omitempty" jsonschema:"description=Registry name,example=foo,example=local,default=standard"` - Version string `validate:"required" yaml:",omitempty" json:"version,omitempty"` - Import string `yaml:",omitempty" json:"import,omitempty"` - Tags []string `yaml:",omitempty" json:"tags,omitempty"` - Description string `yaml:",omitempty" json:"description,omitempty"` - Link string `yaml:",omitempty" json:"link,omitempty"` - Update *Update `yaml:",omitempty" json:"update,omitempty"` - FilePath string `json:"-" yaml:"-"` - GoVersionFile string `json:"go_version_file,omitempty" yaml:"go_version_file,omitempty"` - VersionExpr string `json:"version_expr,omitempty" yaml:"version_expr,omitempty"` - Vars map[string]any `json:"vars,omitempty" yaml:",omitempty"` - CommandAliases []*CommandAlias `json:"command_aliases,omitempty" yaml:"command_aliases,omitempty"` + Name string `validate:"required" json:"name,omitempty"` + Registry string `validate:"required" yaml:",omitempty" json:"registry,omitempty" jsonschema:"description=Registry name,example=foo,example=local,default=standard"` + Version string `validate:"required" yaml:",omitempty" json:"version,omitempty"` + Import string `yaml:",omitempty" json:"import,omitempty"` + Tags []string `yaml:",omitempty" json:"tags,omitempty"` + Description string `yaml:",omitempty" json:"description,omitempty"` + Link string `yaml:",omitempty" json:"link,omitempty"` + Update *Update `yaml:",omitempty" json:"update,omitempty"` + FilePath string `json:"-" yaml:"-"` + GoVersionFile string `json:"go_version_file,omitempty" yaml:"go_version_file,omitempty"` + VersionExpr string `json:"version_expr,omitempty" yaml:"version_expr,omitempty"` + VersionExprPrefix string `json:"version_expr_prefix,omitempty" yaml:"version_expr_prefix,omitempty"` + Vars map[string]any `json:"vars,omitempty" yaml:",omitempty"` + CommandAliases []*CommandAlias `json:"command_aliases,omitempty" yaml:"command_aliases,omitempty"` } type CommandAlias struct {