diff --git a/packages/nx/src/command-line/show/project.ts b/packages/nx/src/command-line/show/project.ts index 048ead0bd7fcd..c7286a3640d22 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?.scriptContent ?? + 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 ?? {} );