File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
packages/angular_devkit/schematics/tools Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,8 @@ export abstract class FileSystemEngineHostBase implements FileSystemEngineHost {
119
119
collection : FileSystemCollectionDesc ,
120
120
desc : Partial < FileSystemSchematicDesc > ) : FileSystemSchematicDesc ;
121
121
122
- private _transforms : OptionTransform < { } , { } > [ ] = [ ] ;
122
+ // tslint:disable-next-line:no-any
123
+ private _transforms : OptionTransform < any , any > [ ] = [ ] ;
123
124
private _contextTransforms : ContextTransform [ ] = [ ] ;
124
125
private _taskFactories = new Map < string , ( ) => Observable < TaskExecutor > > ( ) ;
125
126
@@ -274,10 +275,16 @@ export abstract class FileSystemEngineHostBase implements FileSystemEngineHost {
274
275
switch ( url . protocol ) {
275
276
case null :
276
277
case 'file:' :
277
- return ( context : FileSystemSchematicContext ) => {
278
+ return ( context ) => {
279
+ // Check if context has necessary FileSystemSchematicContext path property
280
+ const fileDescription = context . schematic . description as { path ?: string } ;
281
+ if ( fileDescription . path === undefined ) {
282
+ throw new Error ( 'Unsupported schematic context. Expected a FileSystemSchematicContext.' ) ;
283
+ }
284
+
278
285
// Resolve all file:///a/b/c/d from the schematic's own path, and not the current
279
286
// path.
280
- const root = normalize ( resolve ( context . schematic . description . path , url . path || '' ) ) ;
287
+ const root = normalize ( resolve ( fileDescription . path , url . path || '' ) ) ;
281
288
282
289
return new HostCreateTree ( new virtualFs . ScopedHost ( new NodeJsSyncHost ( ) , root ) ) ;
283
290
} ;
You can’t perform that action at this time.
0 commit comments