<commit_before>#!/bin/bash

# Script to build, deploy and push HAL.Next to branch 'gh-pages'

ROOT=$PWD
BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
BRANCH=${BRANCH:-HEAD}

if ! git diff --no-ext-diff --quiet --exit-code; then
    echo "Cannot publish to gh-pages. You have uncommitted changes in the current branch."
    exit -1
fi

source "$ROOT/spinner.sh"

start_spinner "Building hal.next..."
mvn -q clean install -Dgwt.skipCompilation
stop_spinner $?

start_spinner "Compiling GWT modules"
cd app
mvn -q clean install
cd ${ROOT}
stop_spinner $?

start_spinner "Publishing to gh-pages..."
rm -rf /tmp/hal-app
mv app/target/hal-app-*/hal /tmp/
git checkout gh-pages > /dev/null 2>&1
git reset --hard origin/gh-pages > /dev/null 2>&1
rm -rf *.png *.gif *.ico *.txt *.html *.js
rm -rf css deferredjs fonts img js
mv /tmp/hal/ .
date > .build
git add --all > /dev/null 2>&1
git commit -am "Update hal.next" > /dev/null 2>&1
git push -f origin gh-pages > /dev/null 2>&1
git checkout ${BRANCH} > /dev/null 2>&1
stop_spinner $?

echo "\nHAL.Next successfully published to branch gh-pages."<commit_msg>Tweak publish.sh<commit_after>#!/bin/bash

# Script to build, deploy and push HAL.Next to branch 'gh-pages'

ROOT=$PWD
BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
BRANCH=${BRANCH:-HEAD}

if ! git diff --no-ext-diff --quiet --exit-code; then
    echo "Cannot publish to gh-pages. You have uncommitted changes in the current branch."
    exit -1
fi

source "$ROOT/spinner.sh"

start_spinner "Building hal.next..."
mvn -q clean install -Dgwt.skipCompilation
stop_spinner $?

start_spinner "Compiling app..."
cd app
mvn -q clean install
cd ${ROOT}
stop_spinner $?

start_spinner "Publishing to gh-pages..."
rm -rf /tmp/hal
mv app/target/hal-app-*/hal /tmp/
git checkout gh-pages > /dev/null 2>&1
git reset --hard origin/gh-pages > /dev/null 2>&1
rm -rf *.png *.gif *.ico *.txt *.html *.js
rm -rf css deferredjs fonts img js
mv /tmp/hal/ .
date > .build
git add --all > /dev/null 2>&1
git commit -am "Update hal.next" > /dev/null 2>&1
git push -f origin gh-pages > /dev/null 2>&1
git checkout ${BRANCH} > /dev/null 2>&1
stop_spinner $?

echo "\nHAL.Next successfully published to branch gh-pages."
{'fraction_non_alphanumeric': 0.15188172043010753, 'fraction_numerical': 0.011648745519713262, 'mean_word_length': 3.395669291338583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '2786984', 'n_tokens_mistral': 867, 'n_tokens_neox': 808, 'n_words': 275}