Skip to content

Commit

Permalink
🐛 regression - extracommands require a valid PROJECT file again
Browse files Browse the repository at this point in the history
Handle 3-alpha based on review comments

Signed-off-by: jesus m. rodriguez <jesusr@redhat.com>
  • Loading branch information
jmrodri committed Apr 8, 2021
1 parent 84f357b commit 2a1ff46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ func newCLI(options ...Option) (*CLI, error) {
func (c *CLI) buildCmd() error {
c.cmd = c.newRootCmd()

var uve *config.UnsupportedVersionError

// Get project version and plugin keys.
if err := c.getInfo(); err != nil {
switch err := c.getInfo(); {
case err == nil:
// do nothing if it's nil
case !errors.As(err, &uve):
// Ignore 3-alpha error
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type UnsupportedVersionError struct {
}

// Error implements error interface
func (e UnsupportedVersionError) Error() string {
func (e *UnsupportedVersionError) Error() string {
return fmt.Sprintf("version %s is not supported", e.Version)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ func New(version Version) (Config, error) {
return constructor(), nil
}

return nil, UnsupportedVersionError{Version: version}
return nil, &UnsupportedVersionError{Version: version}
}

0 comments on commit 2a1ff46

Please sign in to comment.