I have a task that registred in grunt config:
grunt.registerTask('test_Branches', 'Run Branches check on windows', require('PATH').check);
And in my branches.test.js I have method check():
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");
}
});
};
But when I'm trying to execute my task through command line with command:
grunt test_Branches
I got:
C:\PATH>grunt test_Branches
Running "test_Branches" task
Execution started
Done, without errors.
What's the problem with my 'exec' method?