<commit_before>'use strict';

module.exports = function(gulp) {
  var spawn = require('child_process').spawn,
      pkg  = require('../package.json');

  if (!pkg.hasOwnProperty('blenderCmd')) {
    return;
  }
  var cmd = pkg.blenderCmd;

  gulp.task('deploy', function() {
    if (cmd.hasOwnProperty('deploy') && cmd.deploy !== '') {
      var deploy = spawn(cmd.deploy);
      deploy.stdout.on('data', function(data) {
        process.stdout.write(data);
      });
    } else {
      console.log('Deployment command is missing! Add blenderCmd.deploy to package.json to use this task!');
    }
  });

};<commit_msg>Using promises for the deploy task. Fixes #25.<commit_after>'use strict';

module.exports = function(gulp) {
  var spawn = require('child_process').spawn,
      pkg  = require('../package.json'),
      Q = require('q');

  if (!pkg.hasOwnProperty('blenderCmd')) {
    console.error('blenderCmd object is missing from configuration.');
    return;
  }
  var cmd = pkg.blenderCmd;

  gulp.task('deploy', function() {
    var deferred = Q.defer();

    if (cmd.hasOwnProperty('deploy') && cmd.deploy !== '') {
      var deploy = spawn(cmd.deploy);
      deploy.stdout.on('data', function(data) {
        process.stdout.write(data);
      });

      deploy.stdout.on('close', function(){
        return deferred.resolve();
      });
    } else {
      console.log('Deployment command is missing! Add blenderCmd.deploy to package.json to use this task!');
      return deferred.resolve();
    }

    return deferred.promise;
  });
};
{'fraction_non_alphanumeric': 0.1650485436893204, 'fraction_numerical': 0.0012944983818770227, 'mean_word_length': 3.0471204188481678, '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': '5648112', 'n_tokens_mistral': 489, 'n_tokens_neox': 465, 'n_words': 104}