mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
add run script
This commit is contained in:
parent
ca0f0194ed
commit
2258643a46
1 changed files with 21 additions and 0 deletions
21
run.sh
Executable file
21
run.sh
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue