简体   繁体   中英

yeoman call generator prompt from sub-generator

I have yo someGen , that prompts few questions. one of the prompts, someQuestion is asking would you like to use smthng? and the user can choose from smthng1 , smthng2 or no .

I have aa sub generator yo someGen:smthng that do something else( smthng1 or smthng2 ) , with regard to the answer from someQuestion .

Now if the user trying yo someGen:smthng , but earlier (in main gen) he answered no , I want to propmt someQuestion again. giving him the chance to decide smthng now, and then operate yo someGen:smthng according to the new answer, with the ability to regret and answer no again.

How would I do that?

Use the yeoman-generator configuration to store user choices. See the documentation http://yeoman.io/authoring/storage.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM