| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2b2e8b3 commit dbfa851
2 files 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 | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 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 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments