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.
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 thechoices
property is a function. We pass the previous answers into bypass function, and inlistTypeBypass
we check ifchoices
is a function and in that case invokes it to get the available choices as an arrayI suppose this can be extended to support checkboxes as well, but that goes beyond my immediate need.