Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node-plop): bypass list prompts with choices being a function #372

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kkckkc
Copy link

@kkckkc kkckkc commented Mar 22, 2023

Fixes #224

While #224 is closed with a workaround, that workaround does not work for me as I rely on a series of list prompts where the available choices depends on previously selected values.

This PR provides a simple fix for handling the list prompt when the choices property is a function. We pass the previous answers into bypass function, and in listTypeBypass we check if choices is a function and in that case invokes it to get the available choices as an array

I suppose this can be extended to support checkboxes as well, but that goes beyond my immediate need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic choices and CLI
1 participant