<commit_before>#!/bin/bash

die () {
    local message=$1
    [ -z "$message" ] && message="Failed, aborting..."
    echo "${BASH_SOURCE[1]}: line ${BASH_LINENO[0]}: ${FUNCNAME[1]}: $message" >&2
    exit 1
}

echo "Starting vagrant box..."

echo "Changing to vagrant/"
cd vagrant/ || die

echo "Taking vagrant up"
vagrant up || die

echo "Checking sandbox status"
SANDBOX_STATUS=$(vagrant sandbox status) || die
if [ "$SANDBOX_STATUS" = "[default] Sandbox mode is off" ]
then
	echo "Creating snapshot"
	vagrant sandbox on
else
	echo "Snapshot already created"
fi

echo "SSH into vagrant"
vagrant ssh || die

echo "Rolling back changes"
vagrant sandbox rollback

echo "Done."<commit_msg>Vagrant should start on port 8001<commit_after>#!/bin/bash

die () {
    local message=$1
    [ -z "$message" ] && message="Failed, aborting..."
    echo "${BASH_SOURCE[1]}: line ${BASH_LINENO[0]}: ${FUNCNAME[1]}: $message" >&2
    exit 1
}

echo "Starting vagrant box..."

echo "Changing to vagrant/"
cd vagrant/ || die

echo "Taking vagrant up"
vagrant up || die

echo "Checking sandbox status"
SANDBOX_STATUS=$(vagrant sandbox status) || die
if [ "$SANDBOX_STATUS" = "[default] Sandbox mode is off" ]
then
	echo "Creating snapshot"
	vagrant sandbox on
else
	echo "Snapshot already created"
fi

echo "SSH into vagrant"
vagrant ssh -c apitry/src/run.sh 8001 || die

echo "Rolling back changes"
vagrant sandbox rollback

#echo "Suspending vagrant"
#vagrant suspend || die

#echo "Stopping vagrant"
#vagrant halt || die

echo "Done."
{'fraction_non_alphanumeric': 0.1382488479262673, 'fraction_numerical': 0.013166556945358789, 'mean_word_length': 4.259515570934256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1728153', 'n_tokens_mistral': 569, 'n_tokens_neox': 540, 'n_words': 177}