File tree Expand file tree Collapse file tree 6 files changed +13
-13
lines changed
Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 88
99import { schema } from '@angular-devkit/core' ;
1010import { readFileSync } from 'node:fs' ;
11- import { join , posix } from 'node:path' ;
11+ import { join , posix , relative } from 'node:path' ;
1212import type { ArgumentsCamelCase , Argv , CommandModule as YargsCommandModule } from 'yargs' ;
1313import { Parser as yargsParser } from 'yargs/helpers' ;
1414import { getAnalyticsUserId } from '../analytics/analytics' ;
@@ -73,9 +73,10 @@ export abstract class CommandModule<T extends {} = {}> implements CommandModuleI
7373 describe : this . describe ,
7474 ...( this . longDescriptionPath
7575 ? {
76- longDescriptionRelativePath : path
77- . relative ( join ( __dirname , '../../../../' ) , this . longDescriptionPath )
78- . replace ( / \\ / g, posix . sep ) ,
76+ longDescriptionRelativePath : relative (
77+ join ( __dirname , '../../../../' ) ,
78+ this . longDescriptionPath ,
79+ ) . replace ( / \\ / g, posix . sep ) ,
7980 longDescription : readFileSync ( this . longDescriptionPath , 'utf8' ) . replace (
8081 / \r \n / g,
8182 '\n' ,
Original file line number Diff line number Diff line change 88
99import { logging } from '@angular-devkit/core' ;
1010import type { Argv , CamelCaseKey } from 'yargs' ;
11- import { PackageManager } from '../package-managers/package-manager' ;
11+ import type { PackageManager } from '../package-managers/package-manager' ;
1212import { AngularWorkspace } from '../utilities/config' ;
1313
1414export enum CommandScope {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
2020 Options ,
2121} from '../../command-builder/command-module' ;
2222import { SchematicEngineHost } from '../../command-builder/utilities/schematic-engine-host' ;
23- import { InstalledPackage , PackageManager , PackageManifest } from '../../package-managers' ;
23+ import type { InstalledPackage , PackageManager , PackageManifest } from '../../package-managers' ;
2424import { colors } from '../../utilities/color' ;
2525import { disableVersionCheck } from '../../utilities/environment-options' ;
2626import { assertIsError } from '../../utilities/error' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { spawnSync } from 'node:child_process';
1111import { existsSync , promises as fs } from 'node:fs' ;
1212import { join , resolve } from 'node:path' ;
1313import * as semver from 'semver' ;
14- import { PackageManager } from '../../../package-managers' ;
14+ import type { PackageManager } from '../../../package-managers' ;
1515import { VERSION } from '../../../utilities/version' ;
1616import { ANGULAR_PACKAGES_REGEXP } from './constants' ;
1717
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export default class VersionCommandModule
5656 */
5757 async run ( options : { json ?: boolean } ) : Promise < void > {
5858 const { logger } = this . context ;
59- const versionInfo = gatherVersionInfo ( this . context ) ;
59+ const versionInfo = await gatherVersionInfo ( this . context ) ;
6060
6161 if ( options . json ) {
6262 // eslint-disable-next-line no-console
Original file line number Diff line number Diff line change 77 */
88
99import { createRequire } from 'node:module' ;
10+ import { CommandContext } from '../../command-builder/definitions' ;
11+ import { PackageManager } from '../../package-managers' ;
1012import { VERSION } from '../../utilities/version' ;
1113
1214/**
@@ -81,10 +83,7 @@ const PACKAGE_PATTERNS = [
8183 * Gathers all the version information from the environment and workspace.
8284 * @returns An object containing all the version information.
8385 */
84- export function gatherVersionInfo ( context : {
85- packageManager : { name : string ; version : string | undefined } ;
86- root : string ;
87- } ) : VersionInfo {
86+ export async function gatherVersionInfo ( context : CommandContext ) : Promise < VersionInfo > {
8887 // Trailing slash is used to allow the path to be treated as a directory
8988 const workspaceRequire = createRequire ( context . root + '/' ) ;
9089
@@ -132,7 +131,7 @@ export function gatherVersionInfo(context: {
132131 } ,
133132 packageManager : {
134133 name : context . packageManager . name ,
135- version : context . packageManager . version ,
134+ version : await context . packageManager . getVersion ( ) ,
136135 } ,
137136 } ,
138137 packages,
You can’t perform that action at this time.
0 commit comments