yonaskolb / Genesis

Templating, scaffolding and generation tool
MIT License
193 stars 18 forks source link

Is there any ways to continue to input options if needed? #14

Open 0x0c opened 2 years ago

0x0c commented 2 years ago

I want to input some options if I want to input those. Is there any ways to do this? For example, I want to generate such file if I want to use Firebase.

{% if firebase %}
FIREBASE_APP_ID = '{{ firebase.app_id }}'
FIREBASE_CI_TOKEN = '{{ firebase.ci_token }}'
FIREBASE_APP_DISTRIBUTION_GROUP = '{{ firebase.app_distribution_group }}'
{% endif %}

This feature may be able to be realized as single attempt of array input option, but I couldn't find how to input options only once.

yonaskolb commented 1 year ago

Hi @0x0c, sorry I'm not sure what you mean. Could you please elaborate?

0x0c commented 1 year ago

@yonaskolb Thank you for your reply.

Currently, using array type option allows to input multiple options until I answer no the first question, like this.

flowchart TD
start[Do you want to use Firebase?] --> |"Yes"| B1[Please input your Firebase app id]
B1 --> B2[Please input your Firebase CI Token.]
B2 --> B3[Please input an app distribution group.]
B3 --> start[Do you want to use Firebase?]
start[Do you want to use Firebase?] -->|"No"| C[Done]

I want to input options only once if I answer yes to first question, like this flowchart. If there is no way to do this, I can make PR.

flowchart TD
start[Do you want to use Firebase?] --> |"Yes"| B1[Please input your Firebase app id]
B1 --> B2[Please input your Firebase CI Token.]
B2 --> B3[Please input an app distribution group.]
B3 --> C
start[Do you want to use Firebase?] -->|"No"| C[Done]