From 91a6eabcfec2d43edff7383a7a18d3e0668a8eab 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 --- 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 029d3ca6e42c..44fec1059d8d 100644 --- a/packages/angular/cli/commands/update-impl.ts +++ b/packages/angular/cli/commands/update-impl.ts @@ -194,7 +194,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 = [];