<commit_before> #!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR

# Returns "*" if the current git branch is dirty.
function git_dirty {
  [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*"
}


if [ git_dirty == "*" ]; then
	echo "Please commit your changes before running this script";
	exit 4
fi

# make sure we aren't on the gh-pages branch
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch_name="(unnamed branch)"     # detached HEAD

if [ "$branch_name" == "gh-pages" ]
then 
	exit 1
fi

cd $DIR/build


# Run doxygen to make sure we have the latest
cmake ..
make docs

# copy those to a tempory directory

TMP_DIR="$(mktemp -d)"

echo "Using tempory directory $TMP_DIR"

cp -r $DIR/build/doc $TMP_DIR/doc

# checkout gh-pages
git checkout gh-pages

# remove the old docs, and not hidden files
rm -rf $(ls $DIR)

# copy them over
cp $TMP_DIR{ $(ls -dm */ $TMP_DIR/doc/html) } $DIR/

# delete the tempory directory
rm -r $TMP_DIR

# start push
git push<commit_msg>Remove dirty git checking --it didn't work<commit_after> #!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR

# make sure we aren't on the gh-pages branch
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch_name="(unnamed branch)"     # detached HEAD

if [ "$branch_name" == "gh-pages" ]
then 
	exit 1
fi

cd $DIR/build


# Run doxygen to make sure we have the latest
cmake ..
make docs

# copy those to a tempory directory

TMP_DIR="$(mktemp -d)"

echo "Using tempory directory $TMP_DIR"

cp -r $DIR/build/doc $TMP_DIR/doc

# checkout gh-pages
git checkout gh-pages

# remove the old docs, and not hidden files
rm -rf $(ls $DIR)

# copy them over
cp $TMP_DIR/doc/html/{ $(ls -dm */ $TMP_DIR/doc/html) } $DIR/

# delete the tempory directory
rm -r $TMP_DIR

# start push
git push
{'fraction_non_alphanumeric': 0.14487249050461204, 'fraction_numerical': 0.0048833423765599565, 'mean_word_length': 3.575682382133995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1147976', 'n_tokens_mistral': 697, 'n_tokens_neox': 658, 'n_words': 238}