#!/bin/bash

# Run sanity check.
./sanityCheck

HASH=`git log -n1 |grep -m1 commit | sed 's/commit //'`

if [ $(uname -m) = "x86_64" ]
then
	echo "x64 arch"
	./devTools/tweeGo/tweego_nix64 -o bin/FC_pregmod_$HASH.html src/
else
	echo "x86 arch"
	./devTools/tweeGo/tweego_nix86 -o bin/FC_pregmod_$HASH.html src/
fi

#Make the output prettier, replacing \t with a tab and \n with a newline
sed -i -e '/^<div id="store-area".*$/s/\\t/\t/g' -e '/^<div id="store-area".*$/s/\\n/\n/g'  bin/FC_pregmod_$HASH.html

echo "FC_pregmod_$HASH.html" compilation finished.
