Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nrwl/nx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5048deb6677538882bedb6e252c9bb8cda41af78
Choose a base ref
..
head repository: nrwl/nx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3ba215b1b91b1f61a05c121a4b5679865ef1b25f
Choose a head ref
Showing with 7 additions and 3 deletions.
  1. +7 −3 packages/nx/src/utils/print-help.ts
10 changes: 7 additions & 3 deletions packages/nx/src/utils/print-help.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { logger } from './logger';
import { output } from './output';
import { Schema } from './params';
import { nxVersion } from './versions';
import { readModulePackageJson } from './package-json';

export function printHelp(
header: string,
@@ -97,6 +98,11 @@ function generateGeneratorOverviewOutput({
// The `:` char
1;

let installedVersion: string;
try {
installedVersion = readModulePackageJson(pluginName).packageJson.version;
} catch {}

ui.div(
...[
{
@@ -107,9 +113,7 @@ function generateGeneratorOverviewOutput({
{
text:
pluginName +
(pluginName.startsWith('@nrwl/')
? chalk.dim(` (v${nxVersion})`)
: ''),
(installedVersion ? chalk.dim(` (v${installedVersion})`) : ''),
padding: [1, 0, 0, 2],
},
]