diff --git a/compile b/compile index 8a76f4a062438c59397aee1a1ec5207296886c24..3a300d82c5c3476962cc952854ffe6bf141f293a 100755 --- a/compile +++ b/compile @@ -23,33 +23,35 @@ then ./sanityCheck fi -case "$(uname -m)" in -x86_64|amd64) - echo "x64 arch" - if [ "$(uname -s)" = "Darwin" ]; then - TWEEGO_EXE="./devTools/tweeGo/tweego_osx64" - else - TWEEGO_EXE="./devTools/tweeGo/tweego_nix64" - fi - ;; -x86|i[3-6]86) - echo "x86 arch" - if [ "$(uname -s)" = "Darwin" ]; then - TWEEGO_EXE="./devTools/tweeGo/tweego_osx86" - else - TWEEGO_EXE="./devTools/tweeGo/tweego_nix86" - fi - ;; -arm*) - echo "arm arch" - # tweego doesn't provide arm binaries so you have to build it yourself - export TWEEGO_PATH=devTools/tweeGo/storyFormats - TWEEGO_EXE="tweego" - ;; -*) - echo "unsupported architecture" - exit 2 -esac +export TWEEGO_PATH=devTools/tweeGo/storyFormats +TWEEGO_EXE="tweego" + +if hash $TWEEGO_EXE 2>/dev/null; then + echo "system tweego binary" +else + case "$(uname -m)" in + x86_64|amd64) + echo "x64 arch" + if [ "$(uname -s)" = "Darwin" ]; then + TWEEGO_EXE="./devTools/tweeGo/tweego_osx64" + else + TWEEGO_EXE="./devTools/tweeGo/tweego_nix64" + fi + ;; + x86|i[3-6]86) + echo "x86 arch" + if [ "$(uname -s)" = "Darwin" ]; then + TWEEGO_EXE="./devTools/tweeGo/tweego_osx86" + else + TWEEGO_EXE="./devTools/tweeGo/tweego_nix86" + fi + ;; + *) + echo "No system tweego binary found, and no pecompiled binary for your platform available" + echo "Please compile tweego and put the executable in PATH" + exit 2 + esac +fi $TWEEGO_EXE -o "bin/FC_pregmod.html" src/ || build_failed="true" diff --git a/compile-git b/compile-git index a50b484b4223b4300b34187ef2e4be4917faf1f6..d462d20c07065fefe92c0832dcc3ff8b20fe1850 100755 --- a/compile-git +++ b/compile-git @@ -5,37 +5,39 @@ HASH="$(git rev-list -n 1 --abbrev-commit HEAD)" -case "$(uname -m)" in -x86_64|amd64) - echo "x64 arch" - if [ "$(uname -s)" = "Darwin" ]; then - TWEEGO_EXE="./devTools/tweeGo/tweego_osx64" - else - TWEEGO_EXE="./devTools/tweeGo/tweego_nix64" - fi - ;; -x86|i[3-6]86) - echo "x86 arch" - if [ "$(uname -s)" = "Darwin" ]; then - TWEEGO_EXE="./devTools/tweeGo/tweego_osx86" - else - TWEEGO_EXE="./devTools/tweeGo/tweego_nix86" - fi - ;; -arm*) - echo "arm arch" - # tweego doesn't provide arm binaries so you have to build it yourself - export TWEEGO_PATH=devTools/tweeGo/storyFormats - TWEEGO_EXE="tweego" - ;; -*) - echo "unsupported architecture" - exit 2 -esac +export TWEEGO_PATH=devTools/tweeGo/storyFormats +TWEEGO_EXE="tweego" + +if hash $TWEEGO_EXE 2>/dev/null; then + echo "system tweego binary" +else + case "$(uname -m)" in + x86_64|amd64) + echo "x64 arch" + if [ "$(uname -s)" = "Darwin" ]; then + TWEEGO_EXE="./devTools/tweeGo/tweego_osx64" + else + TWEEGO_EXE="./devTools/tweeGo/tweego_nix64" + fi + ;; + x86|i[3-6]86) + echo "x86 arch" + if [ "$(uname -s)" = "Darwin" ]; then + TWEEGO_EXE="./devTools/tweeGo/tweego_osx86" + else + TWEEGO_EXE="./devTools/tweeGo/tweego_nix86" + fi + ;; + *) + echo "No system tweego binary found, and no pecompiled binary for your platform available" + echo "Please compile tweego and put the executable in PATH" + exit 2 + esac +fi $TWEEGO_EXE -o "bin/FC_pregmod_$HASH.html" src/ #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. +echo "FC_pregmod_$HASH.html compilation finished."