Skip to content

Commit ebc92c2

Browse files
Keen Yee Liauvikerman
authored andcommitted
refactor(@angular/cli): Simplify retrival of collection name
1 parent 7e1e8ad commit ebc92c2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/angular/cli/commands/new-impl.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ export class NewCommand extends SchematicCommand<NewCommandSchema> {
1717
schematicName = 'ng-new';
1818

1919
async initialize(options: NewCommandSchema & Arguments) {
20-
if (options.collection) {
21-
this.collectionName = options.collection;
22-
} else {
23-
this.collectionName = await this.parseCollectionName(options);
24-
}
20+
this.collectionName = options.collection || await this.getDefaultSchematicCollection();
2521

2622
return super.initialize(options);
2723
}
@@ -43,7 +39,4 @@ export class NewCommand extends SchematicCommand<NewCommandSchema> {
4339
});
4440
}
4541

46-
private async parseCollectionName(options: any): Promise<string> {
47-
return options.collection || this.getDefaultSchematicCollection();
48-
}
4942
}

0 commit comments

Comments
 (0)