-
Notifications
You must be signed in to change notification settings - Fork 25
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
confirm - no kills whole sequence not just current task in sequence #61
Comments
Anyone? @shannonlal is this project still maintained? |
@reintroducing can you provide a sample gulpfile to test |
@reintroducing. The normal flow for it to exit is to return undefined. If you look under the examples directory at the file examples/chain-confirm-gulp.js that when the function stops when the chainFunction returns undefined. var chainFunction = function ( options, resp ){
console.log( 'Here is the selection ', resp);
if( index <= 3){
options.message = `Hello this is iteration ${index}`;
index++;
return options;
}else{
return; //Returning undefined stops the chaining process
}
}; |
@shannonlal Here is an example: https://www.dropbox.com/s/2gngxpcpc7xi7ed/gulp-prompt-test.zip?dl=0 Just download, What i would expect to happen is that |
@reintroducing gulp-prompt allows a user to prompt for user for input but in order to chain them you need to look at adding a chainFunction. See the example (Example Chaining Prompts: in ReadMe file). This will allow you to link multiple user inputs in sequence. With a chain function you essentially take control of the logic as to what questions to ask the user and when to end the sequence. If I go to you initial question it looks like you want to ask the user four questions and do different behaviours based on the inputs. The chain function support will allow you to do this. It is essentially a recursive function that allows you to control the options (i.e. passed to the prompt) from prompt to prompt. The chain function will essentially intercept the result of each prompt, allow the developer to manipulate the options, and send them to the next prompt. When you return undefined it will exit the chain function. Let me know if that answers your questions |
@shannonlal I apologize, I should have been clearer in my prior post. I tried the chainer according to the example you originally pointed out and changed
This essentially puts me in an endless loop if i answer Does that make sense? |
@reintroducing So you are trying to chain to independent gulp tasks. Is this correct? I use this on my internal project at work. I use run-sequence combined with gulp-prompt to collect parameters and then pass those parameters to other gulp tasks. Can you update the attached file to have task1 and task 2 defined and how you would expect to run them together. |
@shannonlal I don't actually need task2 to take anything from task1. i just want task2 to run still if i say 'no' to task1. only thing i need is this, pseudo code:
|
@shannonlal Is there anything else you need me to do to try and help track this down? Does my prior message make sense? |
I have a set of tasks that are run in sequence using run-sequence:
In the
installPeerDeps
task, I'm using gulp-prompt:This works great, however, if I say
n
to the subsequent prompt, I'd expect it to exit out of this task and continue with the next task in the sequence,scaffoldConfigs
, rather than completely exiting thesetup
task.Am I missing something that does this? Or is this the expected behavior and I won't be able to use gulp-prompt for this?
The text was updated successfully, but these errors were encountered: