Freyskeyd/gulp-prompt

Is it possible to loop through an arbitrary number of fields?

JacobDB opened this issue · 4 comments

I'm trying to set up an "init" gulp task that makes it easier for me to get up and running with new projects. I'd like to set up some fields to handle my color variables, but there can be an arbitrary number of colors set. My idea is to continue prompting for additional colors until the user enters a blank value.

Is this possible?

Also, I'd be interested in taking up maintenance for this module if you've abandoned it; I'm not exactly an expert at Node, but I'm decent with vanilla JS and PHP, so I think I'd catch on pretty quickly :)

Jacob,
Can you provide an an example of what this would look like? May be a couple of examples. I think we would need to look at doing this in inquirer.js and bringing that back into gulp-prompt. If this can be done through inquirer.js then I think we could do it.

Also, I noticed that your interested in helping out. I am new to the project and would be willing to work on implementing this with you.

Shannon

For my purposes, this could be implemented in much the same way as #35. I basically just want to keep prompting the user up to x number of times or until they enter nothing as a value.

This would be used for registering color variables, in the following way:

[?] Primary Color: #17AAEC
[?] Primary Alt Color: #57CAFF
[?] Secondary Color: #BA3626
[?] Secondary Alt Color: #FF9486
[?] Tertiary Color: #84B2AA
[?] Tertiary Alt Color: #CDFBF3
[?] Quaternary Color:             # skips remaining because no value was entered
[?] Quaternary Alt Color: [skip]
[?] Quinary Color: [skip]
[?] Quinary Alt Color: [skip]
[?] Senary Color: [skip]
[?] Senary Alt Color: [skip]

The [skip] text is just for demonstration; ideally, those fields would just not be shown.

I have put in a fix for chaining prompts together. Have a look at the readme file for this and the example files. If you require any changes please let me know. This is in version 0.5.0

I finally got around to testing this out, and I could use a little guidance... I'm having difficulty understanding how this works. I'd like to do something like in my example, chaining multiple text inputs, but I can't get this working with prompt.prompt, only with prompt.confirm, which always requires a yes/no response. If it's possible, could you provide an example of how to use this with chaining text inputs?