Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 97a84d4

Browse files
vsavkinhansl
authored andcommitted
fix(@angular-devkit/schematics): fix extends to properly load external schematics'
1 parent 6525b84 commit 97a84d4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,29 +136,25 @@ export abstract class FileSystemEngineHostBase implements
136136
}
137137

138138
const collectionPath = dirname(collection.path);
139-
let partialDesc: Partial<FileSystemSchematicDesc> | null = collection.schematics[name];
139+
const partialDesc: Partial<FileSystemSchematicDesc> | null = collection.schematics[name];
140140
if (!partialDesc) {
141141
throw new UnknownSchematicException(name, collection);
142142
}
143143

144144
if (partialDesc.extends) {
145145
const index = partialDesc.extends.indexOf(':');
146146
const collectionName = index !== -1 ? partialDesc.extends.substr(0, index) : null;
147-
const schematicName = index !== -1 ?
147+
const schematicName = index === -1 ?
148148
partialDesc.extends : partialDesc.extends.substr(index + 1);
149149

150150
if (collectionName !== null) {
151-
// const extendCollection = engine.createCollection(collectionName);
152151
const extendCollection = this.createCollectionDescription(collectionName);
153-
partialDesc = this.createSchematicDescription(schematicName, extendCollection);
152+
153+
return this.createSchematicDescription(schematicName, extendCollection);
154154
} else {
155-
partialDesc = this.createSchematicDescription(schematicName, collection);
155+
return this.createSchematicDescription(schematicName, collection);
156156
}
157157
}
158-
if (!partialDesc) {
159-
throw new UnknownSchematicException(name, collection);
160-
}
161-
162158
// Use any on this ref as we don't have the OptionT here, but we don't need it (we only need
163159
// the path).
164160
if (!partialDesc.factory) {

0 commit comments

Comments
 (0)