File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/@angular/cli/commands Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ export default Command.extend({
7878 `The \`ng generate ${ name } \` command requires a name to be specified.` ) ;
7979 }
8080
81+ if ( / ^ \d / . test ( rawArgs [ 1 ] ) ) {
82+ SilentError . debugOrThrow ( '@angular/cli/commands/generate' ,
83+ `The \`ng generate ${ name } ${ rawArgs [ 1 ] } \` file name cannot begin with a digit.` ) ;
84+ }
85+
8186 rawArgs [ 0 ] = blueprint . name ;
8287 this . registerOptions ( blueprint ) ;
8388 } ,
Original file line number Diff line number Diff line change 1+ import { ng } from '../../utils/process' ;
2+ import { expectToFail } from '../../utils/utils' ;
3+
4+
5+ export default function ( ) {
6+ return Promise . resolve ( )
7+ . then ( ( ) => expectToFail ( ( ) =>
8+ ng ( 'generate' , 'component' , '1my-component' ) ) ) ;
9+ }
You can’t perform that action at this time.
0 commit comments