gulp-prompt icon indicating copy to clipboard operation
gulp-prompt copied to clipboard

How to properly integrate gulp-prompt in the pipe together with other plugins?

Open stefanobartoletti opened this issue 5 years ago • 0 comments

I'm sorry if this question has a simple answer, but I spent quite some time trying to integrate gulp-prompt in my tasks and I don't seem to be able to make it work correctly.

As an example, here is the definition of a sample task, taken from your own examples and slightly modified to be written in the Gulp 4 default task syntax:

function setversion(done) {
	src('test.js')
		.pipe(prompt.prompt({
			type: 'checkbox',
			name: 'bump',
			message: 'What type of bump would you like to do?',
			choices: ['patch', 'minor', 'major']
		}, function(res){
			//value is in res.bump (as an array)
		}))
		.pipe(dest('./'))
	done();
}

exports.setversion = setversion;

If I want, in example, integrate gulp-bump and passing to it the value taken from choices, what exactly should I write in the line that currently has //value is in res.bump (as an array)? Like I said I've tried a lot but can't seem to find the proper syntax to make this work correctly.

Thank you in advance for your help.

stefanobartoletti avatar Jan 15 '20 08:01 stefanobartoletti