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({
78
78
`The \`ng generate ${ name } \` command requires a name to be specified.` ) ;
79
79
}
80
80
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
+
81
86
rawArgs [ 0 ] = blueprint . name ;
82
87
this . registerOptions ( blueprint ) ;
83
88
} ,
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