<commit_before>/*
 * grunt-angular-template-inline-js
 * https://github.com/scriby/grunt-angular-template-inline-js
 *
 * Copyright (c) 2014 scriby
 * Licensed under the MIT license.
 */
'use strict';

var path = require('path');
var compiler = require('angular-template-inline-js');

module.exports = function(grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerMultiTask('angular_template_inline_js', 'A grunt task runner for angular-template-inline-js', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
      key: 'templateUrl'
    });

    // Iterate over all specified file groups.
    this.files.forEach(function(f) {
      f.src.filter(function(filepath) {
        // Warn on and remove invalid source files (if nonull was set).
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      }).map(function(filepath) {
        // Read file source.
        return { path: filepath, contents: grunt.file.read(filepath) };
      }).forEach(function(fileInfo) {
        var compiled = compiler.compile(fileInfo.contents, {
          basePath: options.basePath || path.dirname(fileInfo.path),
          key: options.key
        });

        grunt.file.write(f.dest, compiled);

        grunt.log.writeln('File "' + f.dest + '" created.');
      });
    });
  });

};<commit_msg>Only log to the console when updating the file<commit_after>/*
 * grunt-angular-template-inline-js
 * https://github.com/scriby/grunt-angular-template-inline-js
 *
 * Copyright (c) 2014 scriby
 * Licensed under the MIT license.
 */
'use strict';

var path = require('path');
var compiler = require('angular-template-inline-js');

module.exports = function(grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerMultiTask('angular_template_inline_js', 'A grunt task runner for angular-template-inline-js', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
      key: 'templateUrl'
    });

    // Iterate over all specified file groups.
    this.files.forEach(function(f) {
      f.src.filter(function(filepath) {
        // Warn on and remove invalid source files (if nonull was set).
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          return true;
        }
      }).map(function(filepath) {
        // Read file source.
        return { path: filepath, contents: grunt.file.read(filepath) };
      }).forEach(function(fileInfo) {
        var compiled = compiler.compile(fileInfo.contents, {
          basePath: options.basePath || path.dirname(fileInfo.path),
          key: options.key
        });

        grunt.file.write(f.dest, compiled);

        if(compiled !== fileInfo.contents) {
          grunt.log.writeln('File "' + f.dest + '" written.');
        }
      });
    });
  });

};
{'fraction_non_alphanumeric': 0.13708690330477355, 'fraction_numerical': 0.0024479804161566705, 'mean_word_length': 2.62819089900111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5507974', 'n_tokens_mistral': 963, 'n_tokens_neox': 945, 'n_words': 228}