From b8a655bbc8d4cc292528ca1972c4e3596a68f700 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 20 Oct 2023 20:50:36 +0000 Subject: [PATCH] fix(@angular/cli): remove the need to specify `--migrate-only` when `--name` is used during `ng update` This commit updates the behaviour of `ng update --migrate-only` to remove the need for `--migrate-only` option to be specified. `--migrate-only` will be set internally. Before ``` ng update @angular/cli --migrate-only --name=migration-name ``` Now ``` ng update @angular/cli --name=migration-name ``` --- .../angular/cli/src/commands/update/cli.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts index 906537aa08c5..fe262dbf968d 100644 --- a/packages/angular/cli/src/commands/update/cli.ts +++ b/packages/angular/cli/src/commands/update/cli.ts @@ -107,23 +107,21 @@ export default class UpdateCommandModule extends CommandModule { + if (argv.name) { + argv['migrate-only'] = true; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return argv as any; + }) .check(({ packages, 'allow-dirty': allowDirty, 'migrate-only': migrateOnly }) => { const { logger } = this.context; @@ -1082,9 +1088,7 @@ export default class UpdateCommandModule extends CommandModule