MCPcopy Index your code
hub / github.com/code-pushup/cli / createLogCallbacks

Function createLogCallbacks

packages/ci/src/lib/cli/exec.ts:56–87  ·  view source on GitHub ↗
(context: Pick<CommandContext, 'silent'>)

Source from the content-addressed store, hash-verified

54}
55
56function createLogCallbacks(context: Pick<CommandContext, 'silent'>) {
57 // eslint-disable-next-line functional/no-let
58 let output = '';
59
60 const logOutputChunk = (message: string) => {
61 if (!context.silent) {
62 if (!output) {
63 logger.newline();
64 }
65 logger.info(message, { noIndent: true, noLineBreak: true });
66 }
67 output += message;
68 };
69
70 const logOutputEnd = () => {
71 if (!context.silent && output) {
72 logger.newline();
73 }
74 };
75
76 const logSilencedOutput = () => {
77 if (context.silent) {
78 logger.newline();
79 logger.info(output, { noIndent: true });
80 if (!output.endsWith('\n')) {
81 logger.newline();
82 }
83 }
84 };
85
86 return { logOutputChunk, logOutputEnd, logSilencedOutput };
87}
88
89function combineArgs(
90 args: string[],

Callers 1

executeCliCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected