Skip to content

Commit

Permalink
fix(core): fix output for 0 task (#28122)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

(cherry picked from commit f2dfe90)
  • Loading branch information
xiongemi authored and FrozenPandaz committed Sep 27, 2024
1 parent 950f16a commit 0c5921e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ export async function createRunManyDynamicOutputRenderer({
const timeTakenText = prettyTime(process.hrtime(start));

moveCursorToStartOfPinnedFooter();
if (totalTasks === 0) {
renderPinnedFooter([output.applyNxPrefix('gray', 'No tasks were run')]);
resolveRenderIsDonePromise();
return;
}
if (totalSuccessfulTasks === totalTasks) {
const text = `Successfully ran ${formatTargetsAndProjects(
projectNames,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class StaticRunManyTerminalOutputLifeCycle implements LifeCycle {
) {}

startCommand(): void {
if (this.tasks.length === 0) {
return;
}
if (this.projectNames.length <= 0) {
output.logSingleLine(
`No projects with ${formatTargetsAndProjects(
Expand Down Expand Up @@ -69,6 +72,10 @@ export class StaticRunManyTerminalOutputLifeCycle implements LifeCycle {
endCommand(): void {
output.addNewline();

if (this.tasks.length === 0) {
output.logSingleLine(`No tasks were run`);
return;
}
if (this.failedTasks.length === 0) {
output.addVerticalSeparatorWithoutNewLines('green');

Expand Down

0 comments on commit 0c5921e

Please sign in to comment.