sao
sao copied to clipboard
Execute sub generator, based on some prompt value
Hello. Its possible to execute a sub-generator only if some prompt has a specific value?
Maybe we can add a new type of action:
{
type: 'run-generator',
generator: './generators/some-generator',
when(answers) {
return answers.someCondition
}
}
Yes, I think that would work well.
My use case for this is for example, lets say I want to generate a LICENSE file in multiple generators. I dont want to repeat the code to ask the user to select the type of license for example. Instead I can use another generator to do the task.