From a2ec7d0df13e3e33e3988f38018cbb2f1523658b Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Fri, 17 May 2024 10:04:19 -0400 Subject: [PATCH] feat(core): clean up show project --json false --- packages/nx/src/command-line/show/project.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/nx/src/command-line/show/project.ts b/packages/nx/src/command-line/show/project.ts index 048ead0bd7fcd4..5ca3e0bb0059e8 100644 --- a/packages/nx/src/command-line/show/project.ts +++ b/packages/nx/src/command-line/show/project.ts @@ -47,10 +47,17 @@ export async function showProjectHandler( if (targets.length > 0) { console.log(`${chalk.bold('Targets')}: `); for (const [target, targetConfig] of targets) { + const executorCommandText = + targetConfig.metadata?.runCommand ?? + targetConfig?.options?.command ?? + (targetConfig?.options?.commands?.length === 1 + ? targetConfig.options.commands[0] + : targetConfig?.executor) ?? + ''; console.log( - `- ${chalk.bold((target + ':').padEnd(maxTargetNameLength + 2))} ${( - targetConfig?.executor ?? '' - ).padEnd(maxExecutorNameLength + 2)} ${(() => { + `- ${chalk.bold( + (target + ':').padEnd(maxTargetNameLength + 2) + )} ${executorCommandText.padEnd(maxExecutorNameLength + 2)} ${(() => { const configurations = Object.keys( targetConfig.configurations ?? {} );