diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts index c00d61ece2..c5e7e88390 100644 --- a/packages/angular/cli/src/commands/update/cli.ts +++ b/packages/angular/cli/src/commands/update/cli.ts @@ -70,7 +70,8 @@ export class UpdateCommandModule extends CommandModule { 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 { * @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 { const { version } = await fetchPackageManifest( - `@angular/cli@${this.getCLIUpdateRunnerVersion( - typeof packagesToUpdate === 'string' ? [packagesToUpdate] : packagesToUpdate, - next, - )}`, + `@angular/cli@${this.getCLIUpdateRunnerVersion(packagesToUpdate, next)}`, this.context.logger, { verbose,