<commit_before>/*
 * grunt-gta
 * https://github.com/ZuBB/grunt-gta
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';
var exec = require('child_process').exec;

module.exports = function(grunt) {
    // Please see the Grunt documentation for more information regarding task
    // creation: http://gruntjs.com/creating-tasks
    grunt.registerMultiTask('gta', 'All Git commands for grunt', function() {

        var cb = this.async();
        // Merge task-specific and/or target-specific options with these defaults.
        var options = this.options({
            cwd: process.cwd(),

            punctuation: '.',
            separator: ', ',

            stdout: false,
            stderr: false,

            failOnError: true
        });

        var cmd = this.data.command;

        if (typeof cmd !== 'string') {
            throw new Error('`command` required');
        }

        cmd = 'git ' + cmd;

        grunt.verbose.writeln('Command:', cmd);

        var cp = exec(cmd, {cwd: options.cwd}, function (error) {
            if (error && options.failOnError) {
                grunt.warn(error);
            }
<commit_msg>tasks/gta.js: set command to null by default<commit_after>/*
 * grunt-gta
 * https://github.com/ZuBB/grunt-gta
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';
var exec = require('child_process').exec;

module.exports = function(grunt) {
    // Please see the Grunt documentation for more information regarding task
    // creation: http://gruntjs.com/creating-tasks
    grunt.registerMultiTask('gta', 'All Git commands for grunt', function() {

        var cb = this.async();
        // Merge task-specific and/or target-specific options with these defaults.
        var options = this.options({
            cwd: process.cwd(),
            command: null,

            punctuation: '.',
            separator: ', ',

            stdout: false,
            stderr: false,

            failOnError: true
        });

        var cmd = this.data.command;

        if (typeof cmd !== 'string') {
            throw new Error('`command` required');
        }

        cmd = 'git ' + cmd;

        grunt.verbose.writeln('Command:', cmd);

        var cp = exec(cmd, {cwd: options.cwd}, function (error) {
            if (error && options.failOnError) {
                grunt.warn(error);
            }

{'fraction_non_alphanumeric': 0.1317539484621779, 'fraction_numerical': 0.0033250207813798837, 'mean_word_length': 1.982651796778191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3568949', 'n_tokens_mistral': 715, 'n_tokens_neox': 682, 'n_words': 186}