<commit_before>// Generated by CoffeeScript 1.10.0

/*
  Generate Release
  <NAME>
  MIT License
 */

(function() {
  var ChildProcess, GIT_CLEAN_REGEX, GitCommands, env,
    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  ChildProcess = require('child_process');

  env = process.env;

  env.GIT_MERGE_AUTOEDIT = 'no';

  GIT_CLEAN_REGEX = /^nothing to commit, working directory clean$/m;

  GitCommands = (function() {
    GitCommands.checkForCleanWorkingDirectory = function() {
      var status_result;
      status_result = ChildProcess.execSync('git status', {
        env: env
      });
      if (!GIT_CLEAN_REGEX.test(status_result.toString())) {
        throw new Error('Working directory is not clean, not ready for release');
      }
    };

    GitCommands.prototype.master_branch = 'master';

    GitCommands.prototype.develop_branch = 'develop';

    GitCommands.prototype.remote = 'origin';

    GitCommands.prototype.current_version = void 0;

    GitCommands.prototype.next_version = void 0;

    GitCommands.prototype.release_message = void 0;

    function GitCommands(opts) {
      this.finish = bind(this.finish, this);
      this.commit = bind(this.commit, this);
      this.start = bind(this.start, this);
      this.reset = bind(this.reset, this);
      this.push = bind(this.push, this);
      this.pull = bind(this.pull, this);
      if (opts.master_branch != null) {
        this.master_branch = opts.master_branch;
      }
      if (opts.develop_branch != null) {
        this.develop_branch = opts.develop_branch;
      }
      if (opts.current_version != null) {
        this.current_version = opts.current_version;
      }
      if (opts.next_version != null) {
        this.next_version = opts.next_version;
      }
      if (opts.release_message != null) {
        this.release_message = opts.release_message;
      }
      if (opts.remote != null) {
        this.remote = opts.remote;
      }
      if (!this.current_version) {
        throw new Error('Current Version is not set');
      }
      if (!this.next_version) {
        throw new Error('New Version is not set');
      }
    }

    GitCommands.prototype.exec = function(args) {
      var result;
      result = ChildProcess.spawnSync('git', args, {
        env: env,
        stdio: 'pipe'
      });
      if (result.status !== 0) {
        throw new Error((args.join(' ')) + " returned " + result.status + ". \n\n Output: \n\n " + result.stderr);
      }
    };

    GitCommands.prototype.pull = function() {
      this.exec(['fetch', this.remote]);
      this.exec(['checkout', this.develop_branch]);
      this.exec(['pull', this.remote, this.develop_branch, '--rebase']);
      this.exec(['checkout', this.master_branch]);
      return this.exec(['reset', '--hard', this.remote + "/" + this.master_branch]);
    };

    GitCommands.prototype.push = function() {
      this.exec(['push', this.remote, this.develop_branch]);
      this.exec(['push', this.remote, this.master_branch]);
      return this.exec(['push', this.remote, '--tags']);
    };

    GitCommands.prototype.reset = function() {
      this.exec(['checkout', this.develop_branch]);
      this.exec(['reset', '--hard', 'HEAD']);
      return this.exec(['branch', '-D', "release/" + this.next_version]);
    };

    GitCommands.prototype.start = function() {
      this.exec(['checkout', this.develop_branch]);
      return this.exec(['flow', 'release', 'start', this.next_version]);
    };

    GitCommands.prototype.commit = function(files) {
      var file, i, len;
      for (i = 0, len = files.length; i < len; i++) {
        file = files[i];
        this.exec(['add', file]);
      }
      return this.exec(['commit', '-m', this.release_message]);
    };

    GitCommands.prototype.finish = function() {
      return this.exec(['flow', 'release', 'finish', '-m', this.release_message, this.next_version]);
    };

    return GitCommands;

  })();

  module.exports = GitCommands;

}).call(this);
<commit_msg>Compiled assets from pull request<commit_after>// Generated by CoffeeScript 1.10.0

/*
  Generate Release
  <NAME>
  MIT License
 */

(function() {
  var ChildProcess, GIT_CLEAN_REGEX, GitCommands, env,
    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  ChildProcess = require('child_process');

  env = process.env;

  env.GIT_MERGE_AUTOEDIT = 'no';

  GIT_CLEAN_REGEX = /^nothing to commit,? \(?working directory clean\)?$/m;

  GitCommands = (function() {
    GitCommands.checkForCleanWorkingDirectory = function() {
      var status_result;
      status_result = ChildProcess.execSync('git status', {
        env: env
      });
      if (!GIT_CLEAN_REGEX.test(status_result.toString())) {
        throw new Error('Working directory is not clean, not ready for release');
      }
    };

    GitCommands.prototype.master_branch = 'master';

    GitCommands.prototype.develop_branch = 'develop';

    GitCommands.prototype.remote = 'origin';

    GitCommands.prototype.current_version = void 0;

    GitCommands.prototype.next_version = void 0;

    GitCommands.prototype.release_message = void 0;

    function GitCommands(opts) {
      this.finish = bind(this.finish, this);
      this.commit = bind(this.commit, this);
      this.start = bind(this.start, this);
      this.reset = bind(this.reset, this);
      this.push = bind(this.push, this);
      this.pull = bind(this.pull, this);
      if (opts.master_branch != null) {
        this.master_branch = opts.master_branch;
      }
      if (opts.develop_branch != null) {
        this.develop_branch = opts.develop_branch;
      }
      if (opts.current_version != null) {
        this.current_version = opts.current_version;
      }
      if (opts.next_version != null) {
        this.next_version = opts.next_version;
      }
      if (opts.release_message != null) {
        this.release_message = opts.release_message;
      }
      if (opts.remote != null) {
        this.remote = opts.remote;
      }
      if (!this.current_version) {
        throw new Error('Current Version is not set');
      }
      if (!this.next_version) {
        throw new Error('New Version is not set');
      }
    }

    GitCommands.prototype.exec = function(args) {
      var result;
      result = ChildProcess.spawnSync('git', args, {
        env: env,
        stdio: 'pipe'
      });
      if (result.status !== 0) {
        throw new Error((args.join(' ')) + " returned " + result.status + ". \n\n Output: \n\n " + result.stderr);
      }
    };

    GitCommands.prototype.pull = function() {
      this.exec(['fetch', this.remote]);
      this.exec(['checkout', this.develop_branch]);
      this.exec(['pull', this.remote, this.develop_branch, '--rebase']);
      this.exec(['checkout', this.master_branch]);
      return this.exec(['reset', '--hard', this.remote + "/" + this.master_branch]);
    };

    GitCommands.prototype.push = function() {
      this.exec(['push', this.remote, this.develop_branch]);
      this.exec(['push', this.remote, this.master_branch]);
      return this.exec(['push', this.remote, '--tags']);
    };

    GitCommands.prototype.reset = function() {
      this.exec(['checkout', this.develop_branch]);
      this.exec(['reset', '--hard', 'HEAD']);
      return this.exec(['branch', '-D', "release/" + this.next_version]);
    };

    GitCommands.prototype.start = function() {
      this.exec(['checkout', this.develop_branch]);
      return this.exec(['flow', 'release', 'start', this.next_version]);
    };

    GitCommands.prototype.commit = function(files) {
      var file, i, len;
      for (i = 0, len = files.length; i < len; i++) {
        file = files[i];
        this.exec(['add', file]);
      }
      return this.exec(['commit', '-m', this.release_message]);
    };

    GitCommands.prototype.finish = function() {
      return this.exec(['flow', 'release', 'finish', '-m', this.release_message, this.next_version]);
    };

    return GitCommands;

  })();

  module.exports = GitCommands;

}).call(this);

{'fraction_non_alphanumeric': 0.15687492236989195, 'fraction_numerical': 0.0022357471121599803, 'mean_word_length': 2.753846153846154, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '1967512', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2456, 'n_words': 510}