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