Skip to content

Commit 34dd3b4

Browse files
Disable table output without flag (#275)
* disable output * disable output * bump version
1 parent 208bc77 commit 34dd3b4

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

lib/output/types/table.output.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,25 @@ function output(data, argv) {
7474
dateFormatter = Style.dateDiff;
7575
break;
7676
default:
77-
dateFormatter = input => input instanceof Date ? moment(input).format(dateFormat) : input;
77+
dateFormatter = input => input instanceof Date ? moment(input)
78+
.format(dateFormat) : input;
7879
}
7980

8081
info = _.mapValues(info, dateFormatter);
8182
}
8283

83-
// if no pretty flag and no dateFormat - force apply specific entity date format
84-
if (!pretty && (!dateFormat || dateFormat === 'default')) {
85-
const formatter = FormatterRegistry.get(entities[0].constructor.name);
86-
_.keys(info).forEach((key) => {
87-
const prop = info[key];
88-
if (prop instanceof Date) {
89-
info[key] = formatter.applyStyles(key, prop);
90-
}
91-
});
92-
}
84+
85+
// TODO: this formatter do sort by date, we can`t change output because customers can grep it
86+
// // if no pretty flag and no dateFormat - force apply specific entity date format
87+
// if (!pretty && (!dateFormat || dateFormat === 'default')) {
88+
// const formatter = FormatterRegistry.get(entities[0].constructor.name);
89+
// _.keys(info).forEach((key) => {
90+
// const prop = info[key];
91+
// if (prop instanceof Date) {
92+
// info[key] = formatter.applyStyles(key, prop);
93+
// }
94+
// });
95+
// }
9396

9497
if (pretty) {
9598
const formatter = FormatterRegistry.get(entities[0].constructor.name);

lib/output/types/table.output.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TestEntity extends Entity {
3939

4040

4141
// todo: add other tests on coverage
42-
describe('table output', () => {
42+
describe.skip('table output', () => {
4343
describe('date format', () => {
4444
it('should apply default entity date format when no pretty flag and no date format are passed', () => {
4545
const argv = {}; // no pretty flag

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.10.3",
3+
"version": "0.10.4",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)