<commit_before>'use strict';

/**
 *  Watches specific types of assets, or all, based on a CLI parameter.
 *  When any of these source files associated with an asset type changes
 *  this triggers compilation methods.
 *
 *  Example Usage:
 *  grunt
 *  grunt --watchType styles
 *  grunt --watchType styles,templates
 */

var grunt = require('grunt'),
    args = require('yargs').argv,
    common = require('./_common');

grunt.loadNpmTasks('grunt-contrib-watch');

grunt.config.set('watch', {
    options: {
        interrupt: true
    }
});

grunt.registerTask('default', function() {
    var watchFunctions = {
        styles: function() {
            console.log('Watching styles...');
            grunt.config.set('watch.styles', {
                files: common.watchPaths.styles,
                tasks: ['styles']
            });
        },
        scripts: function() {
            console.log('Watching scripts...');
            grunt.config.set('watch.scripts', {
                files: common.watchPaths.scripts,
                tasks: ['scripts']
            });
        },
        templates: function() {
            console.log('Watching templates...');
            grunt.config.set('watch.templates', {
                files: common.watchPaths.templates,
                tasks: ['templates', 'scripts']
            });
        }
    };

    common.setupWatchers(args, watchFunctions);
    grunt.task.run(['watch']);
});<commit_msg>- Adding the grunt changes to the watch command, so it mirrors the functionality of the gulp version.<commit_after>'use strict';

/**
 *  Watches specific types of assets, or all, based on a CLI parameter.
 *  When any of these source files associated with an asset type changes
 *  this triggers compilation methods.
 *
 *  Example Usage:
 *  grunt
 *  grunt --watchType styles
 *  grunt --watchType styles,templates
 */

var grunt = require('grunt'),
    args = require('yargs').argv,
    common = require('./_common'),
    globalSettings = require('../../_global');

grunt.loadNpmTasks('grunt-contrib-watch');

grunt.config.set('watch', {
    options: {
        interrupt: true
    }
});

grunt.registerTask('default', function() {
    var watchFunctions = {
        styles: function() {
            console.log('Watching styles...');
            grunt.config.set('watch.styles', {
                files: common.watchPaths.styles,
                tasks: ['styles']
            });
        },
        scripts: function() {
            console.log('Watching scripts...');
            grunt.config.set('watch.scripts', {
                files: common.watchPaths.scripts,
                tasks: ['scripts']
            });
        },
        templates: function() {
            console.log('Watching templates...');

            var specificTasks = null;
            if (globalSettings.moduleFormat === 'requirejs') {
                specificTasks = ['templates', 'scripts'];
            } else {
                specificTasks = ['scripts'];
            }

            grunt.config.set('watch.templates', {
                files: common.watchPaths.templates,
                tasks: specificTasks
            });
        }
    };

    common.setupWatchers(args, watchFunctions);
    grunt.task.run(['watch']);
});
{'fraction_non_alphanumeric': 0.13908504758980658, 'fraction_numerical': 0.0, 'mean_word_length': 1.9753424657534246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1974455', 'n_tokens_mistral': 876, 'n_tokens_neox': 848, 'n_words': 202}