<commit_before>#!/bin/bash -e

# Settings.
HTML_PATH=documentation/
BUILD_PATH=build
COMMIT_USER="Automatic documentation builder"
CHANGESET=$(git rev-parse --verify HEAD)

# Hide email from crawlers.
COMMIT_EMAIL="eanelson"
COMMIT_EMAIL="${COMMIT_EMAIL}@eecs"
COMMIT_EMAIL="${COMMIT_EMAIL}.berkeley"
COMMIT_EMAIL="${COMMIT_EMAIL}.edu"

# Make sure branches are up to date.
git remote set-branches --add origin gh-pages
git fetch origin

git config user.name "${COMMIT_USER}"
git config user.email "${COMMIT_EMAIL}"

# Remove stale documentation.
git checkout -b gh-pages origin/gh-pages
if [ -d "${HTML_PATH}" ]; then
  cd ${HTML_PATH}
  git rm -rf ./*
  cd ..
  git commit -a -m "(1 of 2) Deleting documentation. Automated documentation build for changeset ${CHANGESET}."
  git push origin gh-pages
fi

# Make the documentation from source files on the master branch.
git checkout master
if [ -d "${BUILD_PATH}" ]; then
  cd ${BUILD_PATH}
  make documentation
  cd -

  # Checkout the documentation branch.
  git checkout gh-pages

  # Publish the documentation.<commit_msg>Updating travis documentation script.<commit_after>#!/bin/bash -e

# Settings.
HTML_PATH=documentation/
BUILD_PATH=build/
COMMIT_USER="Automatic documentation builder"
CHANGESET=$(git rev-parse --verify HEAD)

# Hide email from crawlers.
COMMIT_EMAIL="eanelson"
COMMIT_EMAIL="${COMMIT_EMAIL}@eecs"
COMMIT_EMAIL="${COMMIT_EMAIL}.berkeley"
COMMIT_EMAIL="${COMMIT_EMAIL}.edu"

# Make sure branches are up to date.
git remote set-branches --add origin gh-pages
git fetch origin

git config user.name "${COMMIT_USER}"
git config user.email "${COMMIT_EMAIL}"

# Remove stale documentation.
git checkout -b gh-pages origin/gh-pages
if [ -d "${HTML_PATH}" ]; then
  cd ${HTML_PATH}

  # Make sure travis has the ability to push.
  openssl aes-256-cbc -K $encrypted_6a2f0cd4845b_key -iv $encrypted_6a2f0cd4845b_iv -in travisci_rsa.enc -out travisci_rsa -d
  chmod 0600 travisci_rsa
  cp travisci_rsa ~/.ssh

  # Delete all documentation and push.
  git rm -rf ./* !(travisci_rsa*)
  cd ..
  git commit -a -m "(1 of 2) Deleting documentation. Automated documentation build for changeset ${CHANGESET}."
  git push origin gh-pages
fi

# Make the documentation from source files on the master branch.
git checkout master
if [ -d "${BUILD_PATH}" ]; then
  cd ${BUILD_PATH}
  make documentation
  cd -

  # Checkout the gh-pages branch, transferring all documentation.
  git checkout gh-pages

  # Publish the documentation.
{'fraction_non_alphanumeric': 0.1090543259557344, 'fraction_numerical': 0.01006036217303823, 'mean_word_length': 4.3926247288503255, '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': '5309879', 'n_tokens_mistral': 857, 'n_tokens_neox': 819, 'n_words': 264}