Gulp任务无法正常退出

时间:2016-10-25 19:59:14

标签: javascript node.js gulp

我有以下安装任务:

gulp.task('install', ['createInfraIniFile']);

gulp.task('createAppIni', function () {

   return gulp.src('')
    .pipe(prompt.prompt([{
        type: 'input',
        name: 'version',
        message: 'Please enter the version ?'
    }], function(res){
        var config = ini.parse(fs.readFileSync('./ini/test_sample.ini', 'utf-8'));

        // Write params into app.ini file
        config.DATA.version = res.version;

        fs.writeFileSync('./ini/test.ini', ini.stringify(config));
    }));

});

gulp.task('createInfraIniFile', ['createAppIni'], function () {

   return gulp.src('')
    .pipe(prompt.prompt([{
        type: 'input',
        name: 'version',
        message: 'Please enter url'
    }], function(res){
        var config = ini.parse(fs.readFileSync('./ini/conf_sample.ini', 'utf-8'));

        // Write params into app.ini file
        config.DATA.url = res.url;

        fs.writeFileSync('./ini/conf.ini', ini.stringify(config));
    }));

});

此任务首先执行createAppIni任务,然后执行createInfraIniFile。但最后,gulp并没有停止执行:

enter image description here

当我执行单个任务时,它工作正常。我的错误在哪里?

0 个答案:

没有答案