<commit_before># Description:
#   Basically pull and die. Like the old days.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   deploy [branch] - Deploy a new branch
#
# Author:
#   sshirokov
util = require 'util'
exec = require('child_process').exec

# DAT DOWNCASE
OPS = ['muta_work']

module.exports = (robot) ->
  robot.respond /deployed\??/, (msg) ->
    exec 'git name-rev --always HEAD', (err, stdout, stderr) ->
      msg.send "Deployed: #{stdout.trim()}"

  robot.respond /deploy(\s@?[\w_\-/]+)?$/, (msg) ->
    remote = 'origin'
    branch = (msg.match[1] or "master").trim()

    if msg.message.user.name.toLowerCase() not in OPS
      msg.reply "Sorry, I can't do that for you."
      return

    prefix = ""
    if remote[0] == '@'
      remote = remote.replace '@', ''
      prefix = "git remote add #{remote} https://github.com/#{remote}/arrakis-hubot"

    msg.send "\"Deploying\" #{origin}/#{branch}"
    exec "#{prefix} ; git fetch --all && git checkout -f '#{origin}/#{branch}'", (err, stdout, stderr) ->
      if err
        msg.send "Something has gone wrong: #{util.inspect err}"
      else<commit_msg>Now it might actually do something, maybe<commit_after># Description:
#   Basically pull and die. Like the old days.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   deploy [branch] - Deploy a new branch
#
# Author:
#   sshirokov
util = require 'util'
exec = require('child_process').exec

# DAT DOWNCASE
OPS = ['muta_work']

module.exports = (robot) ->
  robot.respond /deployed\??/, (msg) ->
    exec 'git name-rev --always HEAD', (err, stdout, stderr) ->
      msg.send "Deployed: #{stdout.trim()}"

  robot.respond /deploy(\s@?[\w_\-/]+)?$/, (msg) ->
    remote = 'origin'
    branch = (msg.match[1] or "master").trim()

    if msg.message.user.name.toLowerCase() not in OPS
      msg.reply "Sorry, I can't do that for you."
      return

    prefix = ""
    if branch[0] == '@' and branch.indexOf('/') != -1
      branch = branch.replace '@', ''
      [remote, branch] = branch.split '/'
      prefix = "git remote add #{remote} https://github.com/#{remote}/arrakis-hubot"

    msg.send "\"Deploying\" #{origin}/#{branch}"
    exec "#{prefix} ; git fetch --all && git checkout -f '#{origin}/#{branch}'", (err, stdout, stderr) ->
      if err
        msg.send "Something has gone wrong: #{util.inspect err}"
      else
{'fraction_non_alphanumeric': 0.18478260869565216, 'fraction_numerical': 0.0020903010033444815, 'mean_word_length': 2.865912762520194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1511062', 'n_tokens_mistral': 828, 'n_tokens_neox': 819, 'n_words': 225}