<commit_before>#!/bin/bash

DIR=$(dirname "$0")

cd $DIR

if [[ $(git status -s) ]]
then
    echo "The working directory is dirty. Please commit any pending changes."
    exit 1;
fi

if [[ ! -d .git/worktrees/_site ]] ; then
    echo "No worktree found for _site!"
    rm -rf _site
    git worktree add -B gh-pages _site origin/gh-pages
    jekyll build
    cd _site
    git add --all && git commit -m "Publishing to gh-pages"
    cd ..
    git push origin gh-pages
    exit
fi

echo "Deleting old publication"
rm -rf _site
mkdir _site
git worktree prune
rm -rf .git/worktrees/_site

echo "Checking out gh-pages branch into _site"
git worktree add -B template _site origin/template

echo "Removing existing files"
rm -rf _site/*

echo "Generating site"
jekyll build

echo "Updating gh-pages branch"
cd _site && git add --all && git commit -m "Publishing _site to gh-pages" && git push
<commit_msg>Removing unused code<commit_after>#!/bin/bash

DIR=$(dirname "$0")

cd $DIR

if [[ $(git status -s) ]]
then
    echo "The working directory is dirty. Please commit any pending changes."
    exit 1;
fi

echo "Deleting old publication"
rm -rf _site
mkdir _site
git worktree prune
rm -rf .git/worktrees/_site

echo "Checking out gh-pages branch into _site"
git worktree add -B gh-pages _site origin/gh-pages

echo "Removing existing files"
rm -rf _site/*

echo "Generating site"
jekyll build

echo "Updating gh-pages branch"
cd _site && git add --all && git commit -m "Publishing _site to gh-pages" && git push

{'fraction_non_alphanumeric': 0.10299003322259136, 'fraction_numerical': 0.0026578073089701, 'mean_word_length': 3.278409090909091, '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': '4953987', 'n_tokens_mistral': 524, 'n_tokens_neox': 498, 'n_words': 208}