Skip to content
Snippets Groups Projects
Commit 5a96c825 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'compile.sh_tweaking' into 'pregmod-master'

compile.sh_tweaking

See merge request pregmodfan/fc-pregmod!4673
parents dd6c9095 c3dd92c3
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment