Skip to content

Commit e84fa72

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular/cli): ensure update migrations are fully executed
With the move to refactor and centralize the update logic, the schematics wrapper context needs to be updated to create an exception for the new location of the update schematic.
1 parent f6e1fd8 commit e84fa72

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/angular/cli/models/schematic-engine-host.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ function shouldWrapSchematic(schematicFile: string): boolean {
3232
}
3333
}
3434

35-
// Never wrap `@schematics/update` when executed directly
35+
// Never wrap the internal update schematic when executed directly
3636
// It communicates with the update command via `global`
37-
if (/[\/\\]node_modules[\/\\]@schematics[\/\\]update[\/\\]/.test(schematicFile)) {
37+
if (/[\/\\]node_modules[\/\\]@angular[\/\\]cli[\/\\]/.test(schematicFile)) {
3838
return false;
3939
}
4040

tests/legacy-cli/e2e/tests/update/update-8.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export default async function () {
1717

1818
// Update Angular to 9
1919
await installPackage('@angular/cli@8');
20-
await ng('update', '@angular/[email protected]', '@angular/[email protected]');
20+
const { stdout } = await ng('update', '@angular/[email protected]', '@angular/[email protected]');
21+
if (!stdout.includes('Executing migrations of package \'@angular/cli\'')) {
22+
throw new Error('Update did not execute migrations. OUTPUT: \n' + stdout);
23+
}
2124

2225
// Update Angular to 10
2326
await ng('update', '@angular/cli@10', '@angular/core@10');

0 commit comments

Comments
 (0)