<commit_before>#!/bin/bash
# Builds current committed master branch from GitHub to gh-pages, replacing everything in gh-pages

# Variables
installed="bundle"

# Get the latest commit SHA in sourcedir branch
last_SHA=( $(git log -n 1 --pretty=oneline) )
# The name of the temporary folder will be the
#   last commit SHA, to prevent possible conflicts
#   with other folder names.
clone_dir="/tmp/clone_$last_SHA/"

# Make sure Jekyll is installed locally
if ! gem list $installed; then
        echo "You do not have the pre-reqs installed. Refer to the README for requirements."
        exit 0
fi

# Create directory to hold temporary clone
mkdir $clone_dir
cd $clone_dir
# Clone a clean copy of master from GitHub
git clone <EMAIL>:justwriteclick/versions-jekyll.git
cd versions-jekyll
# Variable for temporary build output files location
build_dir="/tmp/build_$last_SHA/"
# Check out individual version branches and build those with the gh-pages script to a single build_dir
bundle exec jekyll build --config _config.yml -d /tmp/build_$last_SHA/ > /dev/null 2>&1
      if [ $? = 0 ]; then
        echo "Jekyll build with master branch successful"
      else
        echo "Jekyll build with master branch failed"
        exit 1
      fi

# Rather than hardcoding branch names, use git to list them and go through all
# stable branches

if branch=$(git symbolic-ref --short -q HEAD); then
  echo on branch $branch
  if [[ "$branch" == *"$stable"* ]]; then
      echo "'$branch' is named '$stable'"
      for v in stable/4.1 stable/4.1.1
    do
      git checkout $v
      for i in _4.1.yml _4.1.1.yml
        do
          echo "Build with $i file"
          bundle exec jekyll build --config $i -d /tmp/build_$last_SHA/ > /dev/null 2>&1
          if [ $? = 0 ]; then
            echo "Jekyll build with $1 successful"
          else
            echo "Jekyll build with $1 failed"
            exit 1
          fi
        done
    done

  else
      echo "'$branch' is not a stable branch, it is '$stable'";
  fi
else
  echo not on any branch
fi
# Check out origin gh-pages branch<commit_msg>Build in stable branch files<commit_after>#!/bin/bash
# Builds current committed master branch from GitHub to gh-pages, replacing everything in gh-pages

# Variables
installed="bundle"

# Get the latest commit SHA in sourcedir branch
last_SHA=( $(git log -n 1 --pretty=oneline) )
# The name of the temporary folder will be the
#   last commit SHA, to prevent possible conflicts
#   with other folder names.
clone_dir="/tmp/clone_$last_SHA/"

# Make sure Jekyll is installed locally
if ! gem list $installed; then
        echo "You do not have the pre-reqs installed. Refer to the README for requirements."
        exit 0
fi

# Create directory to hold temporary clone
mkdir $clone_dir
cd $clone_dir
# Clone a clean copy of master from GitHub
git clone <EMAIL>:justwriteclick/versions-jekyll.git
cd versions-jekyll
# Variable for temporary build output files location
build_dir="/tmp/build_$last_SHA/"
# Check out individual version branches and build those with the gh-pages script to a single build_dir
bundle exec jekyll build --config _config.yml -d /tmp/build_$last_SHA/ > /dev/null 2>&1
      if [ $? = 0 ]; then
        echo "Jekyll build with master branch successful"
      else
        echo "Jekyll build with master branch failed"
        exit 1
      fi

# Rather than hardcoding branch names, use git to list them and go through all
# stable branches

if branch=$(git symbolic-ref --short -q HEAD); then
  echo on branch $branch
  if [[ "$branch" == *"$stable"* ]]; then
      echo "'$branch' is named '$stable'"
      for v in 4.1 4.1.1
    do
      git checkout stable/$v
      echo "Build with $i file"
          bundle exec jekyll build --config $i -d /tmp/build_$last_SHA/ > /dev/null 2>&1
          if [ $? = 0 ]; then
            echo "Jekyll build with $1 successful"
          else
            echo "Jekyll build with $1 failed"
            exit 1
          fi
    done
  else
      echo "'$branch' is not a stable branch, it is '$stable'";
  fi
else
  echo not on any branch
fi
# Check out origin gh-pages branch
{'fraction_non_alphanumeric': 0.0848690591658584, 'fraction_numerical': 0.009456838021338506, 'mean_word_length': 2.739800543970988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1035525', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1190, 'n_words': 532}