Skip to content

Commit

Permalink
feat: support version_expr_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Dec 15, 2024
1 parent c897f6f commit b477798
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pkg/config-reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
27 changes: 14 additions & 13 deletions pkg/config/aqua/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b477798

Please sign in to comment.