fix: "recipe version" handles non-catalogue recipes
This commit is contained in:
parent
a9f7579ca9
commit
4ccb4198d6
@ -19,7 +19,6 @@ import (
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
@ -7,9 +7,9 @@ import (
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -47,7 +47,14 @@ var recipeVersionCommand = cli.Command{
|
||||
|
||||
recipeMeta, ok := catl[recipe.Name]
|
||||
if !ok {
|
||||
log.Fatalf("%s is not published on the catalogue?", recipe.Name)
|
||||
log.Warn("no published versions in catalogue, trying local recipe repository")
|
||||
|
||||
recipeVersions, err := recipe.GetRecipeVersions(internal.Offline)
|
||||
if err != nil {
|
||||
log.Warn(err)
|
||||
}
|
||||
|
||||
recipeMeta = recipePkg.RecipeMeta{Versions: recipeVersions}
|
||||
}
|
||||
|
||||
if len(recipeMeta.Versions) == 0 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user