mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +08:00
refactor(@angular/cli): remove coercion from packages
positional configuration
Configure the `packages` positional argument to be an array instead of using `coerce` method.
This commit is contained in:
parent
689c827be5
commit
f11fcaa634
@ -70,7 +70,8 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
|
||||
return localYargs
|
||||
.positional('packages', {
|
||||
description: 'The names of package(s) to update.',
|
||||
coerce: (value) => (typeof value === 'string' ? [value] : value) as string[] | undefined,
|
||||
type: 'string',
|
||||
array: true,
|
||||
})
|
||||
.option('force', {
|
||||
description:
|
||||
@ -872,15 +873,12 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
|
||||
* @returns the version to install or null when there is no update to install.
|
||||
*/
|
||||
private async checkCLIVersion(
|
||||
packagesToUpdate: string[] | string | undefined,
|
||||
packagesToUpdate: string[] | undefined,
|
||||
verbose = false,
|
||||
next = false,
|
||||
): Promise<string | null> {
|
||||
const { version } = await fetchPackageManifest(
|
||||
`@angular/cli@${this.getCLIUpdateRunnerVersion(
|
||||
typeof packagesToUpdate === 'string' ? [packagesToUpdate] : packagesToUpdate,
|
||||
next,
|
||||
)}`,
|
||||
`@angular/cli@${this.getCLIUpdateRunnerVersion(packagesToUpdate, next)}`,
|
||||
this.context.logger,
|
||||
{
|
||||
verbose,
|
||||
|
Loading…
x
Reference in New Issue
Block a user