File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,20 @@ function init() {
135
135
return ;
136
136
}
137
137
138
+ // More detailed error message
139
+ // If users type in generator name with prefix 'generator-'
140
+ if ( cmd . startsWith ( 'generator-' ) ) {
141
+ const generatorName = cmd . replace ( 'generator-' , '' ) ;
142
+ const generatorCommand = chalk . yellow ( 'yo ' + generatorName ) ;
143
+
144
+ console . log ( chalk . red ( 'Installed generators don\'t need the "generator-" prefix.' ) ) ;
145
+ console . log ( `In the future, run ${ generatorCommand } instead!\n` ) ;
146
+
147
+ env . run ( generatorName , firstCmd . opts ) ;
148
+
149
+ return ;
150
+ }
151
+
138
152
// Note: at some point, nopt needs to know about the generator options, the
139
153
// one that will be triggered by the below args. Maybe the nopt parsing
140
154
// should be done internally, from the args.
You can’t perform that action at this time.
0 commit comments