Skip to content

Commit 2af91f6

Browse files
committed
chore: fix logs
1 parent 06ced01 commit 2af91f6

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/nx-plugin/src/executors/cli/executor.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default async function runAutorunExecutor(
2828
normalizedContext,
2929
);
3030
const { dryRun, verbose, command } = mergedOptions;
31-
3231
const commandString = createCliCommandString({
3332
command,
3433
args: cliArgumentObject,
@@ -43,10 +42,6 @@ export default async function runAutorunExecutor(
4342
try {
4443
await executeProcess({
4544
...createCliCommandObject({ command, args: cliArgumentObject }),
46-
observer: {
47-
onError: logger.error,
48-
onStdout: process.stdout.write,
49-
},
5045
...(context.cwd ? { cwd: context.cwd } : {}),
5146
});
5247
} catch (error) {
@@ -58,7 +53,6 @@ export default async function runAutorunExecutor(
5853
};
5954
}
6055
}
61-
6256
return {
6357
success: true,
6458
command: commandString,

packages/nx-plugin/src/executors/internal/cli.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { logger } from '@nx/devkit';
2+
import { ProcessConfig } from '../../internal/execute-process.js';
3+
14
export function createCliCommandString(options?: {
25
args?: Record<string, unknown>;
36
command?: string;
@@ -13,15 +16,19 @@ export function createCliCommandObject(options?: {
1316
args?: Record<string, unknown>;
1417
command?: string;
1518
bin?: string;
16-
}): {
17-
command: string;
18-
args: string[];
19-
cwd?: string;
20-
} {
19+
}): ProcessConfig {
2120
const { bin = '@code-pushup/cli', command, args } = options ?? {};
2221
return {
2322
command: 'npx',
2423
args: [bin, ...objectToCliArgs({ _: command ?? [], ...args })],
24+
observer: {
25+
onError: error => {
26+
logger.error(error.message);
27+
},
28+
onStdout: data => {
29+
logger.log(data);
30+
},
31+
},
2532
};
2633
}
2734

0 commit comments

Comments
 (0)