fix: show N/A if env version unknown

See toolshed/abra#478
This commit is contained in:
2025-01-09 11:35:41 +01:00
parent eb6fe4ba6e
commit ed263854d4
4 changed files with 69 additions and 1 deletions

View File

@ -64,6 +64,15 @@ func NewVersionOverview(
upperKind := strings.ToUpper(kind)
envVersion, err := recipe.GetEnvVersionRaw(app.Recipe.Name)
if err != nil {
return err
}
if envVersion == "" {
envVersion = config.NO_VERSION_DEFAULT
}
rows := [][]string{
{"DOMAIN", domain},
{"RECIPE", app.Recipe.Name},
@ -78,7 +87,7 @@ func NewVersionOverview(
{"VERSION", formatter.BoldDirtyDefault(toDeployVersion)},
{fmt.Sprintf("%s.ENV", strings.ToUpper(app.Domain)), "---"},
{"CURRENT VERSION", formatter.BoldDirtyDefault(app.Recipe.EnvVersion)},
{"CURRENT VERSION", formatter.BoldDirtyDefault(envVersion)},
{"NEW VERSION", formatter.BoldDirtyDefault(toDeployVersion)},
}