Skip to content

Commit b368ac0

Browse files
committed
refactor: fix lint
1 parent 454960b commit b368ac0

3 files changed

Lines changed: 20 additions & 17 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ export default async function runAutorunExecutor(
2121
context: ExecutorContext,
2222
): Promise<ExecutorOutput> {
2323
const normalizedContext = normalizeContext(context);
24-
const {
25-
env,
26-
bin = '@code-pushup/cli',
27-
...mergedOptions
28-
} = mergeExecutorOptions(context.target?.options, terminalAndExecutorOptions);
24+
const { env, bin, ...mergedOptions } = mergeExecutorOptions(
25+
context.target?.options,
26+
terminalAndExecutorOptions,
27+
);
2928
const cliArgumentObject = parseAutorunExecutorOptions(
3029
mergedOptions,
3130
normalizedContext,

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ export function createCliCommandString(options?: {
1313
)}`;
1414
}
1515

16-
export function formatCommandLog(
17-
command: string,
18-
args: string[] = [],
19-
env?: Record<string, string>,
20-
): string {
16+
export function formatCommandLog({
17+
command,
18+
args = [],
19+
env,
20+
}: {
21+
command: string;
22+
args: string[];
23+
env?: Record<string, string>;
24+
}): string {
2125
const logElements: string[] = [];
2226
if (env) {
2327
const envVars = Object.entries(env).map(
@@ -41,10 +45,10 @@ export function createCliCommandObject(options?: {
4145
command?: string;
4246
bin?: string;
4347
}): ProcessConfig {
44-
const { bin = '@code-pushup/cli', command, args } = options ?? {};
48+
const { bin = 'npx @code-pushup/cli', command, args } = options ?? {};
4549
return {
46-
command: 'npx',
47-
args: [bin, ...objectToCliArgs({ _: command ?? [], ...args })],
50+
command: bin,
51+
args: [...objectToCliArgs({ _: command ?? [], ...args })],
4852
observer: {
4953
onError: error => {
5054
logger.error(error.message);

packages/nx-plugin/src/internal/execute-process.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ export function executeProcess(cfg: ProcessConfig): Promise<ProcessResult> {
156156

157157
ui().logger.log(
158158
gray(
159-
`Executing command:\n${formatCommandLog(
160-
'npx',
161-
[command, ...(args ?? [])],
159+
`Executing command:\n${formatCommandLog({
160+
command,
161+
args: args ?? [],
162162
env,
163-
)}\nIn working directory:\n${cfg.cwd ?? process.cwd()}`,
163+
})}\nIn working directory:\n${cfg.cwd ?? process.cwd()}`,
164164
),
165165
);
166166

0 commit comments

Comments
 (0)