简体   繁体   English

子生成器的yeoman调用生成器提示

[英]yeoman call generator prompt from sub-generator

I have yo someGen , that prompts few questions. 我有yo someGen ,提示了几个问题。 one of the prompts, someQuestion is asking would you like to use smthng? 提示之一, someQuestion正在询问would you like to use smthng? and the user can choose from smthng1 , smthng2 or no . 用户可以从smthng1smthng2no

I have aa sub generator yo someGen:smthng that do something else( smthng1 or smthng2 ) , with regard to the answer from someQuestion . 关于someQuestion的答案,我有一个子生成器yo someGen:smthng可以做其他事情( smthng1smthng2 )。

Now if the user trying yo someGen:smthng , but earlier (in main gen) he answered no , I want to propmt someQuestion again. 现在,如果用户尝试yo someGen:smthng ,但是更早(在主要一代中)他回答no ,那么我想再次提示someQuestion 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. 让他有机会立即决定smthng ,然后根据新答案操作yo someGen:smthng ,并具有后悔和no回答的能力。

How would I do that? 我该怎么做?

Use the yeoman-generator configuration to store user choices. 使用yeoman-generator配置来存储用户选择。 See the documentation http://yeoman.io/authoring/storage.html 请参阅文档http://yeoman.io/authoring/storage.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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