This method will allow the pipe to continue if the user input is true, otherwise, it will be terminated.
Default usage:
gulp.src('test.js')
.pipe(prompt.confirm())
.pipe(gulp.dest('dest'));
If a string is provided to the options, it will be set as the message:
gulp.src('test.js')
.pipe(prompt.confirm('Are you ready for Gulp?'))
.pipe(gulp.dest('dest'));
Example when using options:
gulp.src('test.js')
.pipe(prompt.confirm({
message:'Continue?',
default:true
}))
.pipe(gulp.dest('dest'));
.prompt(questions, callback)
This is a clean pass-through function for gulp to utilize the full Inquirer.js Library, please refer to them for documentation on corresponding parameters.
Please note that all types are avaiable, not just the examples below.
Example Input:
gulp.src('test.js')
.pipe(prompt.prompt({
type:'input',
name:'task',
message:'Which task would you like to run?'
},function(res){
//value is in res.task (the name option gives the key)
}));
Example Checkbox:
gulp.src('test.js')
.pipe(prompt.prompt({
type:'checkbox',
name:'bump',
message:'What type of bump would you like to do?',