Skip to content

Commit 7f0333a

Browse files
sumitarorahansl
authored andcommitted
fix(@angular/cli): Fixing generate help command fix
1 parent 8a1b1f9 commit 7f0333a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/@angular/cli/commands/generate.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ const GenerateCommand = EmberGenerateCommand.extend({
2626
// map the blueprint name to allow for aliases
2727
rawArgs[0] = mapBlueprintName(rawArgs[0]);
2828

29-
if (rawArgs[0] !== '--help' &&
30-
!fs.existsSync(path.join(__dirname, '..', 'blueprints', rawArgs[0]))) {
29+
const isHelp: boolean = ['--help', '-h'].indexOf(rawArgs[0]) > -1;
30+
if (!isHelp && !fs.existsSync(path.join(__dirname, '..', 'blueprints', rawArgs[0]))) {
3131
SilentError.debugOrThrow('@angular/cli/commands/generate',
3232
`Invalid blueprint: ${rawArgs[0]}`);
3333
}
3434

35-
if (!rawArgs[1]) {
35+
if (!isHelp && !rawArgs[1]) {
3636
SilentError.debugOrThrow('@angular/cli/commands/generate',
3737
`The \`ng generate ${rawArgs[0]}\` command requires a name to be specified.`);
3838
}

0 commit comments

Comments
 (0)