-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec.sh
More file actions
executable file
·40 lines (31 loc) · 791 Bytes
/
exec.sh
File metadata and controls
executable file
·40 lines (31 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# Exit on error
set -e
BUILD_DIR="build"
# Check for clean option
if [[ "$1" == "clean" ]]; then
echo "[INFO] Removing old build..."
rm -rf "$BUILD_DIR"
echo "[INFO] Clean successful!"
exit 0
fi
# Create build directory if it doesn't exist
if [ ! -d "$BUILD_DIR" ]; then
echo "[INFO] Creating build directory..."
mkdir "$BUILD_DIR"
fi
# Enter build directory
echo "[INFO] Entering build directory..."
cd "$BUILD_DIR"
# Run CMake and make
echo "[INFO] Running CMake..."
cmake ..
echo "[INFO] Compiling with make..."
make -j"$(nproc)"
# Indicator before execution
echo "==================================="
echo " Build successful! Running RayTracer..."
echo "==================================="
# Run the program
./raytracer >"$1".png
feh ./"$1".png