File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
packages/angular_devkit/schematics/tasks Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default function(
67
67
68
68
const rootDirectory = factoryOptions . rootDirectory || process . cwd ( ) ;
69
69
70
- return ( options : NodePackageTaskOptions ) => {
70
+ return ( options : NodePackageTaskOptions = { command : 'install' } ) => {
71
71
let taskPackageManagerProfile = packageManagerProfile ;
72
72
let taskPackageManagerName = packageManagerName ;
73
73
if ( factoryOptions . allowPackageManagerOverride && options . packageManager ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default function(
20
20
) : TaskExecutor < RepositoryInitializerTaskOptions > {
21
21
const rootDirectory = factoryOptions . rootDirectory || process . cwd ( ) ;
22
22
23
- return async ( options : RepositoryInitializerTaskOptions , context : SchematicContext ) => {
23
+ return async ( options : RepositoryInitializerTaskOptions = { } , context : SchematicContext ) => {
24
24
const authorName = options . authorName ;
25
25
const authorEmail = options . authorEmail ;
26
26
Original file line number Diff line number Diff line change @@ -10,7 +10,13 @@ import { RunSchematicTaskOptions } from './options';
10
10
11
11
12
12
export default function ( ) : TaskExecutor < RunSchematicTaskOptions < { } > > {
13
- return ( options : RunSchematicTaskOptions < { } > , context : SchematicContext ) => {
13
+ return ( options : RunSchematicTaskOptions < { } > | undefined , context : SchematicContext ) => {
14
+ if ( ! options ?. name ) {
15
+ throw new Error (
16
+ 'RunSchematicTask requires an options object with a non-empty name property.' ,
17
+ ) ;
18
+ }
19
+
14
20
const maybeWorkflow = context . engine . workflow ;
15
21
const collection = options . collection || context . schematic . collection . description . name ;
16
22
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ function _listAllFiles(root: string): string[] {
81
81
82
82
83
83
export default function ( ) : TaskExecutor < TslintFixTaskOptions > {
84
- return async ( options : TslintFixTaskOptions , context : SchematicContext ) => {
84
+ return async ( options : TslintFixTaskOptions = { } , context : SchematicContext ) => {
85
85
const root = process . cwd ( ) ;
86
86
const tslint = await import ( 'tslint' ) ; // tslint:disable-line:no-implicit-dependencies
87
87
You can’t perform that action at this time.
0 commit comments