Skip to content

Commit f7b32dd

Browse files
committed
fix(commands): remove header colors for committers table
1 parent c3a8054 commit f7b32dd

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/commands/report/committers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Command, Flags } from "@oclif/core";
22
import { makeTable } from "@oclif/table";
33
import { spawnSync } from "node:child_process";
44
import fs from "node:fs";
5+
import { filenamePrefix, GIT_OUTPUT_FORMAT } from "../../config/constants.ts";
56
import {
67
ASCI_COLOR_CODES_REGEX,
78
filenamePrefix,
@@ -186,6 +187,10 @@ export default class Committers extends Command {
186187
end: row.end,
187188
totalCommits: row.totalCommits,
188189
})),
190+
headerOptions: {
191+
color: undefined,
192+
bold: false,
193+
},
189194
});
190195
} else {
191196
finalReport = makeTable({
@@ -218,6 +223,10 @@ export default class Committers extends Command {
218223
name: "Last Commit Date",
219224
},
220225
],
226+
headerOptions: {
227+
color: undefined,
228+
bold: false,
229+
},
221230
});
222231
}
223232
break;
@@ -227,7 +236,7 @@ export default class Committers extends Command {
227236
try {
228237
fs.writeFileSync(
229238
`${filenamePrefix}.${monthly ? "monthly" : "committers"}.${reportFormat}`,
230-
finalReport.replace(ASCI_COLOR_CODES_REGEX, ""),
239+
finalReport,
231240
{
232241
encoding: "utf-8",
233242
},

src/config/constants.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ export const GRAPHQL_PATH = '/graphql';
44
export const ANALYTICS_URL = 'https://apps.herodevs.com/api/eol/track';
55
export const CONCURRENT_PAGE_REQUESTS = 3;
66
export const PAGE_SIZE = 500;
7-
export const GIT_OUTPUT_FORMAT = `"${["%h", "%an", "%ad"].join("|")}"`;
8-
export const ASCI_COLOR_CODES_REGEX =
9-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
7+
export const GIT_OUTPUT_FORMAT = `"${['%h', '%an', '%ad'].join('|')}"`;
108

119
let concurrentPageRequests = CONCURRENT_PAGE_REQUESTS;
1210
const parsed = Number.parseInt(process.env.CONCURRENT_PAGE_REQUESTS ?? '0', 10);

0 commit comments

Comments
 (0)