我有一个在grunt配置中注册的任务:
grunt.registerTask('test_Branches', 'Run Branches check on windows', require('PATH').check);
在我的branches.test.js中我有方法检查():
this.check = function () {
'use strict';
console.log("Execution started\n");
exec('git for-each-ref --sort=-committerdate refs/remotes/origin/ --format='%(committername)', {cwd: currentDir}, function (error, stdout, stderr) {
console.log('started 1.1');
if (stderr) {
console.log('stderr: ' + stderr + "\n");
}
else {
console.log("Authors has been received\n");
}
if (error !== null) {
console.log('Execution command error: ' + error + "\n");
}
});
};
但是当我尝试通过命令行执行我的任务时使用命令:
grunt test_Branches
我得到了:
C:\PATH>grunt test_Branches
Running "test_Branches" task
Execution started
Done, without errors.
我' exec'的问题是什么?方法