Skip to content
Snippets Groups Projects
Commit 80367a6d authored by Arkerthan's avatar Arkerthan
Browse files

compile outside git repo without errors

parent 9df1bffb
No related branches found
No related tags found
1 merge request!5560compile outside git repo without errors
...@@ -63,12 +63,16 @@ function compile { ...@@ -63,12 +63,16 @@ function compile {
exit 2 exit 2
esac esac
fi fi
COMMIT=$(git rev-parse --short HEAD) # Find and insert current commit if [[ -d .git ]]; then
if [[ "$usehash" ]]; then COMMIT=$(git rev-parse --short HEAD) # Find and insert current commit
file="bin/FC_pregmod_${COMMIT}.html" if [[ "$usehash" ]]; then
file="bin/FC_pregmod_${COMMIT}.html"
else
sed -Ei "s/build: .releaseID/\0, commit: $COMMIT/" src/gui/mainMenu/AlphaDisclaimer.tw
file="bin/FC_pregmod.html"
fi
else else
sed -Ei "s/build: .releaseID/\0, commit: $COMMIT/" src/gui/mainMenu/AlphaDisclaimer.tw
file="bin/FC_pregmod.html" file="bin/FC_pregmod.html"
fi fi
...@@ -81,7 +85,9 @@ function compile { ...@@ -81,7 +85,9 @@ function compile {
#Make the output prettier, replacing \t with a tab and \n with a newline #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 sed -i -e '/^.*<div id="store-area".*$/s/\\t/\t/g' -e '/^.*<div id="store-area".*$/s/\\n/\n/g' $file
git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw # Revert AlphaDisclaimer for next compilation if [[ -d .git ]]; then
git checkout -- src/gui/mainMenu/AlphaDisclaimer.tw # Revert AlphaDisclaimer for next compilation
fi
echoMessage "Saved to $file." echoMessage "Saved to $file."
} }
...@@ -125,6 +131,10 @@ fi ...@@ -125,6 +131,10 @@ fi
[ -n "$java" ] && ./sanityCheck.sh java [ -n "$java" ] && ./sanityCheck.sh java
[ -n "$python" ] && ./sanityCheck.sh [ -n "$python" ] && ./sanityCheck.sh
if ! [[ -d .git ]]; then
echoMessage "No git repository. Git specfific actions disabled."
fi
#compile #compile
if [[ "$dry" ]]; then if [[ "$dry" ]]; then
echoMessage "Dry run finished." echoMessage "Dry run finished."
......
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