File tree Expand file tree Collapse file tree
packages/cli/lib/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const doc: DocCommandType = {
2727 if ( ! argv . term ) {
2828 const answer = await PromptSession . chooseTerm ( ) ;
2929 argv . term = answer ;
30- await this . handler ( argv ) ;
30+ await doc . handler ( argv ) ;
3131 } else if ( ! Util . isAlphanumericExt ( argv . term ) ) {
3232 return Util . error ( `The search term '${ argv . term } ' is not valid.` + "\n" +
3333 "Name should start with a letter and can also contain numbers, dashes and spaces." ,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const command: CommandType = {
4040 const templatesByGroup = [ ] ;
4141 const controlGroups : string [ ] = [ ] ;
4242
43- const framework : Framework = this . templateManager . getFrameworkById ( argv . framework ) ;
43+ const framework : Framework = command . templateManager . getFrameworkById ( argv . framework ) ;
4444 if ( ! framework ) {
4545 return Util . error ( "Wrong framework provided" , "red" ) ;
4646 }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export interface CommandType extends CommandModule<{}, any> {
7070 templateManager ?: TemplateManager ;
7171
7272 /** Handler function that will be called by yargs after the command line has been parsed. */
73- handler ( argv : ArgumentsCamelCase < PositionalArgs > ) ;
73+ handler ( /** do not use `this` in handler */ this : void , argv : ArgumentsCamelCase < PositionalArgs > ) ;
7474}
7575
7676export interface NewCommandType extends CommandType {
You can’t perform that action at this time.
0 commit comments