Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 256e38d

Browse files
committedFeb 15, 2018
fix(@angular/cli): Fix help for generate command.
fixes #9412
1 parent 18940e5 commit 256e38d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

Diff for: ‎packages/@angular/cli/commands/generate.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ export default Command.extend({
6464
],
6565

6666
getCollectionName(rawArgs: string[], parsedOptions?: { collection?: string }): [string, string] {
67+
let collectionName: string = CliConfig.getValue('defaults.schematics.collection');
68+
if (!rawArgs || rawArgs.length === 0) {
69+
return [collectionName, null];
70+
}
6771
let schematicName = rawArgs[0];
68-
let collectionName = CliConfig.getValue('defaults.schematics.collection');
6972

7073
if (schematicName.match(/:/)) {
7174
[collectionName, schematicName] = schematicName.split(':', 2);
@@ -206,7 +209,7 @@ export default Command.extend({
206209

207210
printDetailedHelp: function (_options: any, rawArgs: any): string | Promise<string> {
208211
const engineHost = getEngineHost();
209-
const collectionName = this.getCollectionName();
212+
const [collectionName] = this.getCollectionName();
210213
const collection = getCollection(collectionName);
211214
const schematicName = rawArgs[1];
212215
if (schematicName) {

0 commit comments

Comments
 (0)
Please sign in to comment.