Skip to content

Commit 73eeb13

Browse files
Itai GendlerItai Gendler
authored andcommitted
Support showing image annotations
1 parent 1bfe22a commit 73eeb13

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

lib/interface/cli/helpers/get.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ const specifyOutputForArray = (type, enitities) => {
6565
_.forEach(enitities, (entity) => {
6666
jsonArray.push(entity.info);
6767
});
68-
logUpdate(JSON.stringify(jsonArray, null, '\t'));
68+
69+
if (jsonArray.length === 1) {
70+
logUpdate(JSON.stringify(jsonArray[0], null, '\t'));
71+
} else {
72+
logUpdate(JSON.stringify(jsonArray, null, '\t'));
73+
}
74+
6975
break;
7076
case 'yaml':
7177
let yamlArray = {
@@ -74,7 +80,12 @@ const specifyOutputForArray = (type, enitities) => {
7480
_.forEach(enitities, (entity) => {
7581
yamlArray.items.push(entity.info);
7682
});
77-
logUpdate(yaml.safeDump(yamlArray));
83+
84+
if (yamlArray.items.length === 1) {
85+
logUpdate(yaml.safeDump(yamlArray.items[0]));
86+
} else {
87+
logUpdate(yaml.safeDump(yamlArray));
88+
}
7889
break;
7990
case 'name':
8091
_.forEach(enitities, (entity) => {

lib/logic/api/image.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const _extractFieldsForImageEntity = (image, tag) => {
1212
name: image.imageDisplayName,
1313
size: filesize(image.size),
1414
_id: image._id,
15+
annotations: _.get(image, 'metadata', {}),
1516
};
1617
newImage.image_id = image.internalImageId ? image.internalImageId.substring(0, 12) : '\b';
1718
if (_.isEqual(tag, '<none>')) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.6.7",
3+
"version": "0.6.8",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)