<commit_before>#!/bin/bash

set -e

echo "Stopping the engine..."
systemctl stop fabmo

echo "Remounting root partition read-write"
mount -w -o remount /

# DANGER ZONE

echo "Resetting..."
cd /fabmo/engine
git reset --hard HEAD
echo "Fetching tags..."
git fetch origin --tags
echo "Checking out master..."
git checkout master

echo "Fetching master branch..."
git fetch master

echo "Fetching release branches..."
git fetch origin release:release
git fetch origin rc:rc

echo "Updating to version $1..."
git checkout $1
sync

echo "Installing dependencies..."
npm install --production
sync

echo "Saving version information..."
set +e
git describe
INVALID_VERSION=$?
set -e
if [ $INVALID_VERSION -eq 0 ]; then
	VERSION=`git describe`
	echo "{\"number\" : \"$VERSION\" }" > /fabmo/engine/version.json
else
	rm /fabmo/engine/version.json || true
fi
sync

sleep 3<commit_msg>Speed up engine updates substantially<commit_after>#!/bin/bash

set -e

echo "Stopping the engine..."
systemctl stop fabmo

echo "Remounting root partition read-write"
mount -w -o remount /

# DANGER ZONE

echo "Resetting..."
cd /fabmo/engine
git reset --hard HEAD
echo "Fetching tags..."
git fetch origin --tags
echo "Checking out master..."
git checkout master

echo "Fetching master branch..."
git fetch

echo "Fetching release branches..."
git fetch origin release:release
git fetch origin rc:rc

echo "Updating to version $1..."
git checkout $1
sync

echo "Installing dependencies..."
npm install --production
sync

echo "Saving version information..."
set +e
git describe
INVALID_VERSION=$?
set -e
if [ $INVALID_VERSION -eq 0 ]; then
	VERSION=`git describe`
	echo "{\"number\" : \"$VERSION\" }" > /fabmo/engine/version.json
else
	rm /fabmo/engine/version.json || true
fi
sync

sleep 3
{'fraction_non_alphanumeric': 0.12478729438457176, 'fraction_numerical': 0.0045377197958026095, 'mean_word_length': 3.716577540106952, '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': '1347643', 'n_tokens_mistral': 565, 'n_tokens_neox': 551, 'n_words': 218}