add run script

This commit is contained in:
Shuo Feng 2024-03-04 02:57:58 -05:00
parent ca0f0194ed
commit 2258643a46
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1

21
run.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
# Build the cmake project
cmake -S . -B build
cmake --build build
# Check if the build was successful
if [ ! -d "build" ]; then
echo "Build directory not found. Build failed."
exit 1
fi
# Run the program for each json file in the specified filepath
for jsonfile in "assets"/*.json; do
if [ -f "$jsonfile" ]; then
echo "Processing $jsonfile..."
build/raytracer "$jsonfile"
else
echo "No JSON files found in $FILEPATH."
break
fi
done