Skip to content

Commit 9230362

Browse files
committed
fix(@angular/cli): ng-update migrations not running with --migrate-only
With Angular CLI version 8, migrations cannot be re-run with the `--migrate-only` flag as there was a recent regression introduced in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes a normalized platform path to the `engine.createCollection` call. This breaks as there is incorrect logic within `node-modules-engine-host` that causes the schematic collection to be searched within the `package.json#schematics` entry. This is incorrect as migration schematics specify their migration schematics in a separate schematic collection file which is part of `package.json#ng-update`. Fixes #14565
1 parent 3afdab2 commit 9230362

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular_devkit/schematics/tools/node-module-engine-host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class NodeModulesEngineHost extends FileSystemEngineHostBase {
7979
protected _resolveCollectionPath(name: string): string {
8080
let collectionPath: string | undefined = undefined;
8181

82-
if (name.replace(/\\/, '/').split('/').length > (name[0] == '@' ? 2 : 1)) {
82+
if (name.replace(/\\/g, '/').split('/').length > (name[0] == '@' ? 2 : 1)) {
8383
try {
8484
collectionPath = this._resolvePath(name, process.cwd());
8585
} catch {

0 commit comments

Comments
 (0)