@code-pushup/cli
Version:
A CLI to run all kinds of code quality measurements to align your team with company goals
23 lines • 993 B
JavaScript
import ansis from 'ansis';
import { compareReportFiles } from '@code-pushup/core';
import { logger } from '@code-pushup/utils';
import { yargsCompareOptionsDefinition } from '../implementation/compare.options.js';
import { printCliCommand } from '../implementation/logging.js';
export function yargsCompareCommandObject() {
const command = 'compare';
return {
command,
describe: 'Compare 2 report files and create a diff file',
builder: yargsCompareOptionsDefinition(),
handler: async (args) => {
printCliCommand(command);
const options = args;
const { before, after, label, persist, upload } = options;
const outputPaths = await compareReportFiles({ persist, upload }, { before, after, label });
logger.info(`Reports diff written to ${outputPaths
.map(path => ansis.bold(path))
.join(' and ')}`);
},
};
}
//# sourceMappingURL=compare-command.js.map