From 008094bd1690aa73fdfd18852fd7b8b274c22e7f Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 18 Oct 2021 14:34:52 +0200 Subject: [PATCH] fix(@angular/cli): run stable migrations when package version is prerelease With this change we fix an issue were migrations are not run when the version specified in migration collection is specified as stable example `13.0.0`, but the version specified in the `package.json` is still a prerelease example `13.0.0-rc.0`. Closes: #21969 (cherry picked from commit ebf2d6253576c556e79b4135fe642552edd415d8) --- packages/angular/cli/commands/update-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/cli/commands/update-impl.ts b/packages/angular/cli/commands/update-impl.ts index c6abf4a59d7b..ef916346ce55 100644 --- a/packages/angular/cli/commands/update-impl.ts +++ b/packages/angular/cli/commands/update-impl.ts @@ -199,7 +199,7 @@ export class UpdateCommand extends Command { ): Promise { const collection = this.workflow.engine.createCollection(collectionPath); const migrationRange = new semver.Range( - '>' + (semver.prerelease(from) ? from.split('-')[0] + '-0' : from) + ' <=' + to, + '>' + (semver.prerelease(from) ? from.split('-')[0] + '-0' : from) + ' <=' + to.split('-')[0], ); const migrations = [];