Skip to content

Commit

Permalink
Added suppress warnings for console.log calls
Browse files Browse the repository at this point in the history
  • Loading branch information
amullabaev committed Sep 20, 2019
1 parent 3d93df4 commit 6bcc2b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/commands/ember-cli-jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@ module.exports = {

return new rsvp.Promise( function( resolve, reject ) {
exec( cmdPath + ' -c jsdoc.json', { cwd: process.cwd() }, function( error, stdout, stderr ) {
// eslint-disable-next-line no-console
console.log( stderr );

var shouldReject = false;

if ( error ) {
// eslint-disable-next-line no-console
console.log( chalk.red( 'EMBER-CLI-JSDOC: ERRORS have occurred during documentation generation' ) );
shouldReject = true;
}

if ( /WARNING/.test( stderr ) ) {
// eslint-disable-next-line no-console
console.log( chalk.yellow( 'EMBER-CLI-JSDOC: WARNINGS have occurred during documentation generation' ) );
}

if ( shouldReject ) {
reject();

} else {
// eslint-disable-next-line no-console
console.log( chalk.green( 'EMBER-CLI-JSDOC: Documentation was successfully generated' ) );
resolve();
}
Expand Down

0 comments on commit 6bcc2b9

Please sign in to comment.