Skip to content

Commit

Permalink
fix(@angular/cli): Fixing generate help command fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitarora authored and hansl committed Mar 13, 2017
1 parent 8a1b1f9 commit 7f0333a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@angular/cli/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const GenerateCommand = EmberGenerateCommand.extend({
// map the blueprint name to allow for aliases
rawArgs[0] = mapBlueprintName(rawArgs[0]);

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

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

0 comments on commit 7f0333a

Please sign in to comment.