<commit_before>const async = require('async');
const fs = require('fs');
const gitRev = require('git-rev');

const config = require('../config');
const utils = require('./utils');

const execCommand = utils.execCommand;

const GITHUB_TOKEN = process.env.GITHUB_TOKEN;

const CDN = 'https://cdn.jsdelivr.net/gh/aframevr/aframe@';
const CDN_PATH = 'dist/aframe-master.min.js';

/**
 * Bump A-Frame master build on every commit.
 */
function bumpAframeDist (data) {
  if (!shouldBumpAframeDist(data)) { return Promise.resolve(false); }

  return new Promise(resolve => {
    console.log(`Bumping ${config.repo} dist...`);
    // Bump dist/.
    async.series([
      execCommand('git reset --hard HEAD', 'aframe'),
      execCommand('git pull --rebase origin master', 'aframe'),
      execCommand('npm install --only="dev"', 'aframe'),
      execCommand('npm install', 'aframe'),
      execCommand('npm run dist', 'aframe'),
      execCommand('git status', 'aframe'),
      execCommand('git add -A .', 'aframe'),
      execCommand(`git commit -m "Bump aframe-master dist/ builds. (${data.compare})"`,
                  'aframe'),
    ], err => {
      // Bump CDN URLs.
      if (process.env.AFROBOT_ENV !== 'test') { process.chdir('./aframe'); }
      gitRev.short(hash => {
        if (process.env.AFROBOT_ENV !== 'test') { process.chdir('../'); }
        async.series([
          cb => replaceReadmeCdnUrls(hash, cb),
          execCommand('git status', 'aframe'),
          execCommand('git add -A .', 'aframe'),
          execCommand(`git commit -m "Update master CDN URL. ` +
                      `(${CDN}${hash}/${CDN_PATH})"`, 'aframe'),
          execCommand(
            `git push https://${GITHUB_TOKEN}@github.com/${config.repo}.git master`,
            'aframe'),
          execCommand(
            `git push https://${GITHUB_TOKEN}@github.com/${config.userName}/aframe.git ` +
            `master -f`, 'aframe')
        ], function asyncSeriesDone (err) {
          if (err) { return console.error(err); }
          console.log(`${config.repo} dist successfully bumped!`);
          resolve(true);
        });<commit_msg>use long hash<commit_after>const async = require('async');
const fs = require('fs');
const gitRev = require('git-rev');

const config = require('../config');
const utils = require('./utils');

const execCommand = utils.execCommand;

const GITHUB_TOKEN = process.env.GITHUB_TOKEN;

const CDN = 'https://cdn.jsdelivr.net/gh/aframevr/aframe@';
const CDN_PATH = 'dist/aframe-master.min.js';

/**
 * Bump A-Frame master build on every commit.
 */
function bumpAframeDist (data) {
  if (!shouldBumpAframeDist(data)) { return Promise.resolve(false); }

  return new Promise(resolve => {
    console.log(`Bumping ${config.repo} dist...`);
    // Bump dist/.
    async.series([
      execCommand('git reset --hard HEAD', 'aframe'),
      execCommand('git pull --rebase origin master', 'aframe'),
      execCommand('npm install --only="dev"', 'aframe'),
      execCommand('npm install', 'aframe'),
      execCommand('npm run dist', 'aframe'),
      execCommand('git status', 'aframe'),
      execCommand('git add -A .', 'aframe'),
      execCommand(`git commit -m "Bump aframe-master dist/ builds. (${data.compare})"`,
                  'aframe'),
    ], err => {
      // Bump CDN URLs.
      if (process.env.AFROBOT_ENV !== 'test') { process.chdir('./aframe'); }
      gitRev.long(hash => {
        if (process.env.AFROBOT_ENV !== 'test') { process.chdir('../'); }
        async.series([
          cb => replaceReadmeCdnUrls(hash, cb),
          execCommand('git status', 'aframe'),
          execCommand('git add -A .', 'aframe'),
          execCommand(`git commit -m "Update master CDN URL. ` +
                      `(${CDN}${hash}/${CDN_PATH})"`, 'aframe'),
          execCommand(
            `git push https://${GITHUB_TOKEN}@github.com/${config.repo}.git master`,
            'aframe'),
          execCommand(
            `git push https://${GITHUB_TOKEN}@github.com/${config.userName}/aframe.git ` +
            `master -f`, 'aframe')
        ], function asyncSeriesDone (err) {
          if (err) { return console.error(err); }
          console.log(`${config.repo} dist successfully bumped!`);
          resolve(true);
        });
{'fraction_non_alphanumeric': 0.18015482054890922, 'fraction_numerical': 0.0, 'mean_word_length': 2.6853932584269664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 6, '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': '2319332', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1336, 'n_words': 294}