【发布时间】:2015-07-12 18:44:18
【问题描述】:
我有一个非常繁重的 gulp 任务,我想问用户他是否真的想启动该任务。
我已经看到了 gulp-confirm 和 gulp-prompt,但这对我没有帮助:
我不想管道'确认'我只是不想在用户确认之前开始繁重的任务。
我正在尝试实现这样的目标:
gulp.task('confirm', [], function ()
{
//Ask the confirm question here and cancel all task if the user abort
prompt.confirm({
message: 'This task will create a new tag version\n. Are you sure you want to continue?',
default: true
});
});
gulp.task('Build Release QA', ['confirm'], function ()//use this task to make release to QA
{
//very heavy task, don't start it if user abort it from 'confirm' task
});
有什么想法吗?
【问题讨论】:
标签: node.js gulp prompt confirm