mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
fix(@angular-devkit/schematics): merge external schematics after execution
When an `externalSchematic` rule was used, the input tree was branched but never merged back into the input tree. This resulted in a different tree instance being returned from the rule. The `externalSchematic` rule now behaves like the `schematic` rule which merges the trees.
This commit is contained in:
parent
8688de462e
commit
495459a8a3
@ -29,7 +29,14 @@ export function externalSchematic<OptionT extends object>(
|
|||||||
const collection = context.engine.createCollection(collectionName, context.schematic.collection);
|
const collection = context.engine.createCollection(collectionName, context.schematic.collection);
|
||||||
const schematic = collection.createSchematic(schematicName);
|
const schematic = collection.createSchematic(schematicName);
|
||||||
|
|
||||||
return schematic.call(options, observableOf(branch(input)), context, executionOptions);
|
return schematic.call(options, observableOf(branch(input)), context, executionOptions).pipe(
|
||||||
|
last(),
|
||||||
|
map(x => {
|
||||||
|
input.merge(x, MergeStrategy.AllowOverwriteConflict);
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user