<commit_before>module.exports = function (sails) {

  /**
   * Module dependencies
   */
   var Err          = require('../../../errors');
   var path         = require('path');
   var ChildProcess = require('child_process');
   var _            = require('lodash');
   var fs           = require('fs');


   return {


    /**
     * Initialize this project's Grunt tasks
     * and execute the environment-specific gruntfile
     *
     */
     initialize: function (cb) {

      sails.log.verbose('Loading app Gruntfile...');

      // Start task depending on environment
      if(sails.config.environment === 'production'){
        return this.runTask('prod', cb);
      }
      this.runTask('default', cb);
    },


    /**
     * Fork Grunt child process
     *
     * @param {String} taskName - grunt task to run
     * @param {Function} cb - optional, fires when the Grunt task has been started (non-production) or finished (production)
     */
     runTask: function (taskName, cb_afterTaskStarted) {
      cb_afterTaskStarted = cb_afterTaskStarted || function () {};

      var environment = sails.config.environment;
      var pathToSails = path.resolve(__dirname, '../../../');

      // Only relevant in a development environment:<commit_msg>be grunt as optionally hook<commit_after>module.exports = function (sails) {

  /**
   * Module dependencies
   */
   var Err          = require('../../../errors');
   var path         = require('path');
   var ChildProcess = require('child_process');
   var _            = require('lodash');
   var fs           = require('fs');


   return {


    /**
     * Initialize this project's Grunt tasks
     * and execute the environment-specific gruntfile
     *
     */
     initialize: function (cb) {

      sails.log.verbose('Loading app Gruntfile...');

      // Start task depending on environment
      if(sails.config.environment === 'production'){
        return this.runTask('prod', cb);
      }
      this.runTask('default', cb);
    },


    /**
     * Fork Grunt child process
     *
     * @param {String} taskName - grunt task to run
     * @param {Function} cb - optional, fires when the Grunt task has been started (non-production) or finished (production)
     */
     runTask: function (taskName, cb_afterTaskStarted) {
      cb_afterTaskStarted = cb_afterTaskStarted || function () {};

      if (!fs.existsSync(path.resolve('node_modules', 'grunt-cli'))) return cb_afterTaskStarted();

      var environment = sails.config.environment;
      var pathToSails = path.resolve(__dirname, '../../../');

      // Only relevant in a development environment:
{'fraction_non_alphanumeric': 0.13414634146341464, 'fraction_numerical': 0.0, 'mean_word_length': 2.3567774936061383, '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': '4086875', 'n_tokens_mistral': 740, 'n_tokens_neox': 711, 'n_words': 196}