build-system/tasks/json-check.js
/**
 * Fail if JSON files are valid.
 */
Fail if JSON files are valid.
Fail if JSON files are valid .
function checkValidJson() {
  var hasError = false;
  return gulp.src(jsonGlobs)
      .pipe(through2.obj(function(file, enc, cb) {
        try {
          JSON.parse(file.contents.toString());
        } catch (e) {
          util.log(util.colors.red('Invalid JSON in '
              + file.relative + ': ' + e.message));
          hasError = true;
        }
      }))
      .on('end', function() {
        if (hasError) {
          process.exit(1);
        }
      });
  }
function checkValidJson ( ) { var hasError = false ; return gulp . src ( jsonGlobs ) . pipe ( through2 . obj ( function ( file , enc , cb ) { try { JSON . parse ( file . contents . toString ( ) ) ; } catch ( e ) { util . log ( util . colors . red ( 'Invalid JSON in ' + file . relative + ': ' + e . message ) ) ; hasError = true ; } } ) ) . on ( 'end' , function ( ) { if ( hasError ) { process . exit ( 1 ) ; } } ) ; }
Fail if JSON files are valid.
Fail if JSON files are valid .