File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ const GenerateCommand = EmberGenerateCommand.extend({
12
12
return ;
13
13
}
14
14
15
+ // map the blueprint name to allow for aliases
16
+ rawArgs [ 0 ] = mapBlueprintName ( rawArgs [ 0 ] ) ;
17
+
15
18
if ( ! fs . existsSync ( path . join ( __dirname , '..' , 'blueprints' , rawArgs [ 0 ] ) ) ) {
16
19
SilentError . debugOrThrow ( 'angular-cli/commands/generate' , `Invalid blueprint: ${ rawArgs [ 0 ] } ` ) ;
17
20
}
@@ -20,6 +23,18 @@ const GenerateCommand = EmberGenerateCommand.extend({
20
23
}
21
24
} ) ;
22
25
26
+ function mapBlueprintName ( name ) {
27
+ let mappedName = aliasMap [ name ] ;
28
+ return mappedName ? mappedName : name ;
29
+ }
30
+
31
+ const aliasMap = {
32
+ 'c' : 'component' ,
33
+ 'd' : 'directive' ,
34
+ 'p' : 'pipe' ,
35
+ 'r' : 'route' ,
36
+ 's' : 'service'
37
+ } ;
23
38
24
39
module . exports = GenerateCommand ;
25
40
module . exports . overrideCore = true ;
You can’t perform that action at this time.
0 commit comments