Skip to content

Commit

Permalink
Merge pull request #120 from Raynes/errors
Browse files Browse the repository at this point in the history
Only fail on error, add option to ignore warnings
  • Loading branch information
krampstudio committed May 24, 2015
2 parents 49b6e84 + e53dec4 commit c08d2f6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tasks/jsdoc-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,18 @@ module.exports = function jsDocTask(grunt) {

//execution of the jsdoc command
var child = exec.buildSpawned(grunt, jsDoc, srcs, options);
child.stdout.on('data', function (data) {
grunt.log.debug('jsdoc output : ' + data);
});
child.stderr.on('data', function (data) {
grunt.log.error('An error occurs in jsdoc process:\n' + data);
grunt.fail.warn('jsdoc failure', errorCode.task);

child.stdout.on('data', grunt.log.debug)
child.stderr.on('data', function(data) {
if (!options.ignoreWarnings)
grunt.log.error(data);
});
child.on('exit', function(code){
if(code === 0){
grunt.log.write('Documentation generated to ' + path.resolve(options.destination));
done(true);
} else {
grunt.log.error('jsdoc terminated');
grunt.fail.warn('jsdoc failure', errorCode.task);
grunt.fail.warn('jsdoc terminated with a non-zero exit code', errorCode.task);
}
});
});
Expand Down

0 comments on commit c08d2f6

Please sign in to comment.