diff --git a/compile.sh b/compile.sh index c55accb7..16776b1d 100755 --- a/compile.sh +++ b/compile.sh @@ -20,26 +20,28 @@ runOrFail() { fi } -runOrFail $(pwd)/compile_stub.sh "Failed to compile stub!" +declare -a run_steps=( + 'compile_stub.sh "Failed to compile stub!"' + 'compile_vergen.sh "Versions failed to compile"' + 'compile_sources.sh "Failed to compile FPC Sources!"' + 'compile_link.sh "Failed linking!"' + 'compile_isogen.sh "Failed to create ISO!"' +) -#Generate .pas with versioning headers. -runOrFail $(pwd)/compile_vergen.sh "Versions failed to compile" - -#Compile all .pas sources -runOrFail $(pwd)/compile_sources.sh "Failed to compile FPC Sources!" - -#Link into a binary. -runOrFail $(pwd)/compile_link.sh "Failed linking!" - -#Generate an ISO with GRUB as the Bootloader. -runOrFail ./compile_isogen.sh "Failed to create ISO!" +for command in "${run_steps[@]}" +do + if [ "$ERRCOUNT" -eq "0" ] + then + runOrFail $(pwd)/$command + fi +done #Call generate final artifacts based on failure or success of the above. if [ "$ERRCOUNT" -ne "0" ] then - ./compile_finish.sh "failed" + . ./compile_finish.sh "failed" else - ./compile_finish.sh "success" + . ./compile_finish.sh "success" fi cd .. \ No newline at end of file diff --git a/compile_vergen.sh b/compile_vergen.sh index 22ece737..cb9ae513 100644 --- a/compile_vergen.sh +++ b/compile_vergen.sh @@ -14,8 +14,6 @@ file="version" wget -q https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver -O bin/semver && chmod +x bin/semver export PATH="$(pwd)/bin:$PATH" } -pwd -ls tagref=$(git describe --tags) revision=$(git rev-parse --short=8 HEAD) major=$(semver get major $tagref)