diff --git a/compile.sh b/compile.sh index 2c4a6fc90afdbbe2851a7f63a401f8a4fd5f718c..e95ba242189270cdfc588f850037fb2d6b47b3f4 100755 --- a/compile.sh +++ b/compile.sh @@ -64,47 +64,27 @@ function compile { if [[ "$usehash" ]]; then HASH="$(git rev-list -n 1 --abbrev-commit HEAD)" - - $TWEEGO_EXE -o "bin/FC_pregmod_${HASH}_tmp.html" src/ --head devTools/head.html || build_failed="true" - - if [ "$build_failed" = "true" ] - then - echoError "Build failed." - 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_${HASH}_tmp.html" \ - && mv "bin/FC_pregmod_${HASH}_tmp.html" "bin/FC_pregmod_${HASH}.html" - - ln -s ../resources bin/ 2> /dev/null - - echoMessage "Saved to bin/FC_pregmod_$HASH.html." - + file="bin/FC_pregmod_${HASH}.html" else - # Find and insert current commit - COMMIT=$(git rev-parse --short HEAD) + COMMIT=$(git rev-parse --short HEAD) # Find and insert current commit sed -Ei "s/build .releaseID/\0 commit $COMMIT/" src/gui/mainMenu/AlphaDisclaimer.tw + file="bin/FC_pregmod.html" + fi - $TWEEGO_EXE -o "bin/FC_pregmod_tmp.html" src/ --head devTools/head.html || build_failed="true" - - # Revert AlphaDisclaimer for next compilation - git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw - - if [ "$build_failed" = "true" ] - then - echoError "Build failed." - exit 1 - fi + $TWEEGO_EXE -o $file src/ --head devTools/head.html || build_failed="true" - #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_tmp.html \ - && mv bin/FC_pregmod_tmp.html bin/FC_pregmod.html + if [ "$build_failed" = "true" ] + then + echoError "Build failed." + exit 1 + fi - ln -s ../resources bin/ 2> /dev/null + #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' $file - echoMessage "Saved to bin/FC_pregmod.html." - fi + ln -s ../resources bin/ 2> /dev/null + if [[ ! "$usehash" ]]; then git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw;fi # Revert AlphaDisclaimer for next compilation + echoMessage "Saved to $file." } if [[ "$1" == "" ]]; then @@ -145,7 +125,6 @@ fi # Run sanity check. [ -n "$java" ] && ./sanityCheck.sh java - [ -n "$python" ] && ./sanityCheck.sh #compile @@ -154,4 +133,4 @@ if [[ "$dry" ]]; then else compile echoMessage "Compilation finished." -fi +fi \ No newline at end of file