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 @@ -72,6 +72,11 @@ export default Command.extend({
72
72
`The \`ng generate ${ name } \` command requires a name to be specified.` ) ;
73
73
}
74
74
75
+ if ( / ^ \d / . test ( rawArgs [ 1 ] ) ) {
76
+ SilentError . debugOrThrow ( '@angular/cli/commands/generate' ,
77
+ `The \`ng generate ${ name } ${ rawArgs [ 1 ] } \` file name cannot begin with a digit.` ) ;
78
+ }
79
+
75
80
rawArgs [ 0 ] = blueprint . name ;
76
81
this . registerOptions ( blueprint ) ;
77
82
} ,
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