Skip to content

Commit e3c7d6e

Browse files
committed
lib list: always output rows in table output, even if the "library.Release" field is not set
1 parent 409a133 commit e3c7d6e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Diff for: cli/lib/list.go

+14-11
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,22 @@ func (ir installedResult) String() string {
140140
location = lib.GetContainerPlatform()
141141
}
142142

143+
available := ""
144+
sentence := ""
143145
if libMeta.GetRelease() != nil {
144-
available := libMeta.GetRelease().GetVersion()
145-
if available == "" {
146-
available = "-"
147-
}
148-
sentence := lib.Sentence
149-
if sentence == "" {
150-
sentence = "-"
151-
} else if len(sentence) > 40 {
152-
sentence = sentence[:37] + "..."
153-
}
154-
t.AddRow(name, lib.Version, available, location, sentence)
146+
available = libMeta.GetRelease().GetVersion()
147+
sentence = lib.Sentence
148+
}
149+
150+
if available == "" {
151+
available = "-"
152+
}
153+
if sentence == "" {
154+
sentence = "-"
155+
} else if len(sentence) > 40 {
156+
sentence = sentence[:37] + "..."
155157
}
158+
t.AddRow(name, lib.Version, available, location, sentence)
156159
}
157160

158161
return t.Render()

0 commit comments

Comments
 (0)