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 {
|
} else {
|
||||||
const args = getCommandArgsForTask(Object.values(taskGraph.tasks)[0]);
|
const args = getCommandArgsForTask(Object.values(taskGraph.tasks)[0]);
|
||||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
output.logCommand(args.join(' '));
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ export class ForkedProcessTaskRunner {
|
|||||||
try {
|
try {
|
||||||
const args = getCommandArgsForTask(task);
|
const args = getCommandArgsForTask(task);
|
||||||
if (forwardOutput) {
|
if (forwardOutput) {
|
||||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
output.logCommand(args.join(' '));
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
}
|
}
|
||||||
const p = fork(this.cliPath, args, {
|
const p = fork(this.cliPath, args, {
|
||||||
@ -163,7 +163,7 @@ export class ForkedProcessTaskRunner {
|
|||||||
try {
|
try {
|
||||||
const args = getCommandArgsForTask(task);
|
const args = getCommandArgsForTask(task);
|
||||||
if (forwardOutput) {
|
if (forwardOutput) {
|
||||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`);
|
output.logCommand(args.join(' '));
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
}
|
}
|
||||||
const p = fork(this.cliPath, args, {
|
const p = fork(this.cliPath, args, {
|
||||||
|
|||||||
@ -16,10 +16,7 @@ export class EmptyTerminalOutputLifeCycle implements LifeCycle {
|
|||||||
cacheStatus === 'skipped'
|
cacheStatus === 'skipped'
|
||||||
) {
|
) {
|
||||||
const args = getCommandArgsForTask(task);
|
const args = getCommandArgsForTask(task);
|
||||||
output.logCommand(
|
output.logCommand(args.join(' '), cacheStatus);
|
||||||
`${args.filter((a) => a !== 'run').join(' ')}`,
|
|
||||||
cacheStatus
|
|
||||||
);
|
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
process.stdout.write(terminalOutput);
|
process.stdout.write(terminalOutput);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,10 +147,7 @@ export class StaticRunManyTerminalOutputLifeCycle implements LifeCycle {
|
|||||||
terminalOutput: string
|
terminalOutput: string
|
||||||
) {
|
) {
|
||||||
const args = getCommandArgsForTask(task);
|
const args = getCommandArgsForTask(task);
|
||||||
output.logCommand(
|
output.logCommand(args.join(' '), cacheStatus);
|
||||||
`${args.filter((a) => a !== 'run').join(' ')}`,
|
|
||||||
cacheStatus
|
|
||||||
);
|
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
process.stdout.write(terminalOutput);
|
process.stdout.write(terminalOutput);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,7 +118,7 @@ export class StaticRunOneTerminalOutputLifeCycle implements LifeCycle {
|
|||||||
task.target.project === this.initiatingProject
|
task.target.project === this.initiatingProject
|
||||||
) {
|
) {
|
||||||
const args = getCommandArgsForTask(task);
|
const args = getCommandArgsForTask(task);
|
||||||
output.logCommand(`${args.filter((a) => a !== 'run').join(' ')}`, status);
|
output.logCommand(args.join(' '), status);
|
||||||
output.addNewline();
|
output.addNewline();
|
||||||
process.stdout.write(terminalOutput);
|
process.stdout.write(terminalOutput);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,6 +207,13 @@ class CLIOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logCommand(message: string, taskStatus?: TaskStatus) {
|
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();
|
this.addNewline();
|
||||||
let commandOutput = `${chalk.dim('> nx run')} ${message}`;
|
let commandOutput = `${chalk.dim('> nx run')} ${message}`;
|
||||||
if (taskStatus === 'local-cache') {
|
if (taskStatus === 'local-cache') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user