Files
Modularity/build.sh
Anemunt 157e9ed6a5
Some checks failed
Build C++ Project with Fedora Container and Create Release / build (push) Has been cancelled
more detailed + nicer looking Logging for Build.sh
2025-12-04 16:49:26 -05:00

37 lines
954 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
start_time=$(date +%s)
finish() {
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
if [ $exit_code -eq 0 ]; then
echo -e "[Complete]: Your Modularity Build Completed in ${duration}s!\nThe build should be located under Modularity within another folder called 'Build'"
else
echo "[!]: Your Modularity Build Failed after ${duration}s (exit code ${exit_code})."
fi
exit $exit_code
}
trap finish EXIT
echo -e "================================\n Modularity - Native Linux Builder\n================================"
git submodule update --init --recursive
if [ -d "build" ]; then
echo -e "[i]: Oh! We found an existing build directory.\nRemoving existing folder..."
rm -rf build/
echo -e "[i]: Build Has been Removed\nContinuing build"
fi
mkdir -p build
cd build
cmake ..
cmake --build . -- -j"$(nproc)"
cp -r ../Resources .