Skip to content

Commit

Permalink
feat(core): clean up show project --json false (#23486)
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` -->

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

<img width="657" alt="Screenshot 2024-05-27 at 1 54 08 PM"
src="https://github.com/nrwl/nx/assets/16211801/b66bbf57-1d75-485f-bf8e-17a28579a7e5">

## 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 #
  • Loading branch information
xiongemi authored May 27, 2024
1 parent 6292055 commit a7c5603
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/nx/src/command-line/show/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? {}
);
Expand Down

0 comments on commit a7c5603

Please sign in to comment.