<commit_before>#!/usr/bin/env bash

COMMIT_MSG=$(git log -1 --pretty=%B)

if [[ $COMMIT_MSG != *"[release]"* ]]
then
    echo "skipping, not a release commit"
    exit 0
fi

echo "./bin/box build"
./bin/box build

VAGRUN_REMOTE_VERSION=$(curl https://raw.githubusercontent.com/ideatosrl/vagrun/gh-pages/version)
VAGRUN_LOCAL_VERSION=$(cat .git/refs/heads/master)

if [ "$VAGRUN_REMOTE_VERSION" = "$VAGRUN_LOCAL_VERSION" ]
then
    echo "release already deployed"
    exit 0
fi

if [ $? -ne 0 ]
then
    echo "box build fails"
    exit 0
fi

echo "cat .git/refs/heads/master > version"
cat .git/refs/heads/master > version

echo "cp ./vagrun.phar /tmp/vagrun"
cp ./vagrun.phar /tmp/vagrun

echo "cp ./version /tmp/vagrun"
cp ./version /tmp/vagrun

echo "cd /tmp/vagrun"
cd /tmp/vagrun

if git status --porcelain | grep .; then
    echo "git add vagrun.phar"<commit_msg>Improved .phar generation [release]<commit_after>#!/usr/bin/env bash

COMMIT_MSG=$(git log -1 --pretty=%B)

if [[ $COMMIT_MSG != *"[release]"* ]]
then
    echo "skipping, not a release commit"
    exit 0
fi

VAGRUN_REMOTE_VERSION=$(curl https://raw.githubusercontent.com/ideatosrl/vagrun/gh-pages/version)
VAGRUN_LOCAL_VERSION=$(cat .git/refs/heads/master)

if [ "$VAGRUN_REMOTE_VERSION" = "$VAGRUN_LOCAL_VERSION" ]
then
    echo "release already deployed"
    exit 0
fi

echo "./bin/box build"
./bin/box build

if [ $? -ne 0 ]
then
    echo "box build fails"
    exit 0
fi

echo "cat .git/refs/heads/master > version"
cat .git/refs/heads/master > version

echo "cp ./vagrun.phar /tmp/vagrun"
cp ./vagrun.phar /tmp/vagrun

echo "cp ./version /tmp/vagrun"
cp ./version /tmp/vagrun

echo "cd /tmp/vagrun"
cd /tmp/vagrun

if git status --porcelain | grep .; then
    echo "git add vagrun.phar"
{'fraction_non_alphanumeric': 0.14846416382252559, 'fraction_numerical': 0.005688282138794084, 'mean_word_length': 3.408521303258145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5542674', 'n_tokens_mistral': 719, 'n_tokens_neox': 683, 'n_words': 174}