<commit_before>const { exec } = require('child_process')
const ora = require('ora')
const config = require('../config')

const spinner = ora('Deploy to gh-pages...')
spinner.start()

function execute (cmd) {
  return new Promise((resolve, reject) => {
    exec(cmd, (err, stdout, stderr) => {
      if (err) return reject(err)
      if (stderr) return reject(stderr)
      resolve(stdout)
    })
  })
}

execute(`cd ${config.paths.output}`)
  .then(stdout => {
    return execute('git add --all')
  })
  .then(stdout => {
    return execute(`git commit -m 'Update @ ${new Date}'`)
  })
  .then(stdout => {
    return execute('git push -u origin gh-pages')
  })
  .then(stdout => {
    spinner.stop()
  })
  .catch(err => {
    throw err
    spinner.stop()
  })
<commit_msg>Update @ Sat Mar 11 2017 17:01:32 GMT+0800 (CST)<commit_after>const { exec } = require('child_process')
const ora = require('ora')
const config = require('../config')

const spinner = ora('Deploy to gh-pages...')
spinner.start()

function execute (cmd) {
  return new Promise((resolve, reject) => {
    exec(cmd, (err, stdout, stderr) => {
      if (err) return reject(err)
      if (stderr) return reject(stderr)
      resolve(stdout)
    })
  })
}

execute(`cd ${config.paths.output}`)
  .then(stdout => {
    execute('pwd').then(s => console.log(s.toString()))
    return execute('git add --all')
  })
  .then(stdout => {
    return execute(`git commit -m 'Update @ ${new Date}'`)
  })
  .then(stdout => {
    return execute('git push -u origin gh-pages')
  })
  .then(stdout => {
    spinner.stop()
  })
  .catch(err => {
    throw err
    spinner.stop()
  })

{'fraction_non_alphanumeric': 0.18631643249847282, 'fraction_numerical': 0.009773976786805132, 'mean_word_length': 3.064516129032258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '1022163', 'n_tokens_mistral': 577, 'n_tokens_neox': 558, 'n_words': 135}