-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): register schematic aliases when providing collecti…
…on name in `ng generate` Previously, schematic aliases were not registered when a collection name was provided to `ng generate`. Example: `ng generate c` where `c` is an alias for `component` would work, but `ng generate @schematics/angular:c` would fail. This commits fixes the schematic registration to handle the latter case. Closes #24518
- Loading branch information
1 parent
89b9d94
commit 3ebb195
Showing
2 changed files
with
65 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ng } from '../../utils/process'; | ||
|
||
export default async function () { | ||
const schematicNameVariation = [ | ||
'component', | ||
'c', | ||
'@schematics/angular:component', | ||
'@schematics/angular:c', | ||
]; | ||
|
||
for (const schematic of schematicNameVariation) { | ||
await ng('generate', schematic, 'comp-name', '--display-block', '--dry-run'); | ||
} | ||
} |