File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/angular/cli/src/commands/add Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,11 @@ export default class AddCommandModule
100100 // `ng add @angular/localize -- --package-options`.
101101 . strict ( false ) ;
102102
103- const collectionName = await this . getCollectionName ( ) ;
103+ const collectionName = this . getCollectionName ( ) ;
104+ if ( ! collectionName ) {
105+ return localYargs ;
106+ }
107+
104108 const workflow = this . getOrCreateWorkflowForBuilder ( collectionName ) ;
105109
106110 try {
@@ -401,8 +405,11 @@ export default class AddCommandModule
401405 return false ;
402406 }
403407
404- private async getCollectionName ( ) : Promise < string > {
408+ private getCollectionName ( ) : string | undefined {
405409 let [ , collectionName ] = this . context . args . positional ;
410+ if ( ! collectionName ) {
411+ return undefined ;
412+ }
406413
407414 // The CLI argument may specify also a version, like `ng add @my/[email protected] `, 408415 // but here we need only the name of the package, like `@my/lib`
You can’t perform that action at this time.
0 commit comments