Newer
Older
#!/bin/bash
while [[ "$1" ]]
do
case $1 in
--insane)
insane="true"
;;
*)
echo "Unknown argument $1"
exit 1
esac
shift
done
COMMIT=$(git rev-parse --short HEAD)
sed -Ei "s/build .releaseID/\0 commit $COMMIT/" src/gui/mainMenu/AlphaDisclaimer.tw
if [[ ! "$insane" ]]
then
# Run sanity check.
./sanityCheck
fi
ARCH="$(uname -m)"
if [ "$ARCH" = "x86_64" ]
./devTools/tweeGo/tweego_nix64 -o bin/FC_pregmod.html src/ || build_failed="true"
elif echo "$ARCH" | grep -Ee '86$' > /dev/null
then
./devTools/tweeGo/tweego_nix86 -o bin/FC_pregmod.html src/ || build_failed="true"
elif echo "$ARCH" | grep -Ee '^arm' > /dev/null
then
echo "arm arch"
# tweego doesn't provide arm binaries so you have to build it yourself
tweego -o bin/FC_pregmod.html src/ || build_failed="true"
# Revert AlphaDisclaimer for next compilation
git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw
if [ "$build_failed" = "true" ]
then
exit 1
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.html