From 44275601ba0e4c7b8c24f8184a33d09350a0fbef 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 ``` (cherry picked from commit 2c1c67624503f0b16923f8be98f38250f8bbc185) --- .../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 5b9f45e85c32..c09a0d0289aa 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; @@ -1084,9 +1090,7 @@ export default class UpdateCommandModule extends CommandModule