fix(core): normalize command to avoid nx run nx run (#8678)
This commit is contained in:
parent
e167fd5992
commit
acffba7fa9
@ -40,7 +40,7 @@ export class ForkedProcessTaskRunner {
|
||||
);
|
||||
} else {
|
||||
const args = getCommandArgsForTask(Object.values(taskGraph.tasks)[0]);
|
||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
||||
output.logCommand(args.join(' '));
|
||||
output.addNewline();
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ export class ForkedProcessTaskRunner {
|
||||
try {
|
||||
const args = getCommandArgsForTask(task);
|
||||
if (forwardOutput) {
|
||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
||||
output.logCommand(args.join(' '));
|
||||
output.addNewline();
|
||||
}
|
||||
const p = fork(this.cliPath, args, {
|
||||
@ -163,7 +163,7 @@ export class ForkedProcessTaskRunner {
|
||||
try {
|
||||
const args = getCommandArgsForTask(task);
|
||||
if (forwardOutput) {
|
||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
||||
output.logCommand(args.join(' '));
|
||||
output.addNewline();
|
||||
}
|
||||
const p = fork(this.cliPath, args, {
|
||||
|
||||
@ -16,10 +16,7 @@ export class EmptyTerminalOutputLifeCycle implements LifeCycle {
|
||||
cacheStatus === 'skipped'
|
||||
) {
|
||||
const args = getCommandArgsForTask(task);
|
||||
output.logCommand(
|
||||
`${args.filter((a) => a !== 'run').join(' ')}`,
|
||||
cacheStatus
|
||||
);
|
||||
output.logCommand(args.join(' '), cacheStatus);
|
||||
output.addNewline();
|
||||
process.stdout.write(terminalOutput);
|
||||
}
|
||||
|
||||
@ -147,10 +147,7 @@ export class StaticRunManyTerminalOutputLifeCycle implements LifeCycle {
|
||||
terminalOutput: string
|
||||
) {
|
||||
const args = getCommandArgsForTask(task);
|
||||
output.logCommand(
|
||||
`${args.filter((a) => a !== 'run').join(' ')}`,
|
||||
cacheStatus
|
||||
);
|
||||
output.logCommand(args.join(' '), cacheStatus);
|
||||
output.addNewline();
|
||||
process.stdout.write(terminalOutput);
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ export class StaticRunOneTerminalOutputLifeCycle implements LifeCycle {
|
||||
task.target.project === this.initiatingProject
|
||||
) {
|
||||
const args = getCommandArgsForTask(task);
|
||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`, status);
|
||||
output.logCommand(args.join(' '), status);
|
||||
output.addNewline();
|
||||
process.stdout.write(terminalOutput);
|
||||
}
|
||||
|
||||
@ -207,6 +207,13 @@ class CLIOutput {
|
||||
}
|
||||
|
||||
logCommand(message: string, taskStatus?: TaskStatus) {
|
||||
// normalize the message
|
||||
if (message.startsWith('nx run ')) {
|
||||
message = message.substring('nx run '.length);
|
||||
} else if (message.startsWith('run ')) {
|
||||
message = message.substring('run '.length);
|
||||
}
|
||||
|
||||
this.addNewline();
|
||||
let commandOutput = `${chalk.dim('> nx run')} ${message}`;
|
||||
if (taskStatus === 'local-cache') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user