loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Prompt issue by creating controller with specified config

Open canmustu opened this issue 5 years ago • 4 comments

Steps to reproduce

I specified an option ( controllerType ) to create controller not to prompt me the question but It still prompts me for controllerType. I tried this option by passing config file and other way which is --controllerType REST way but same behaviour.

My config.json

{
  "controllerType": "REST"
}

My controller creation CLI command:

lb4 controller test --config config.json

Current Behavior

Prompt me to choose a controller type:

? What kind of controller would you like to generate? (Use arrow keys)
❯ Empty Controller 
  REST Controller with CRUD functions 

Expected Behavior

Not to prompt me about specified controller type.

canmustu avatar Apr 12 '21 22:04 canmustu

Please see this comment for example. The controllerType should be REST Controller with CRUD functions.

dhmlau avatar Apr 16 '21 01:04 dhmlau

@dhmlau, This config is working, thanks.

{
  "name": "Widget",
  "modelName": "Widget",
  "controllerType": "REST Controller with CRUD functions",
  "repositoryName": "WidgetRepository",
  "idType": "string",
  "httpPathName": "/widget"
}

canmustu avatar Apr 17 '21 22:04 canmustu

Hello @canmustu 1- I have created config.json file at the root 2- I pasted the config you mentioned and made the proper changes to work with my model and repo. 3- I ran the following command : lb4 controller -c config.json
and it is not picking from the config file and still prompts me questions to answer is there any missing step should be done in addition to the mentioned 3 steps above?

AbanoubSamySalib avatar Nov 09 '21 11:11 AbanoubSamySalib

I'm also having an issue on Windows. Can't get this to work either with config file or using --controllerType option. I get prompted no matter what I do.

tm8747a avatar Dec 23 '21 04:12 tm8747a