From 2258643a464dfc5c4188c185fa7defb82f04d7a5 Mon Sep 17 00:00:00 2001 From: vonhyou Date: Mon, 4 Mar 2024 02:57:58 -0500 Subject: [PATCH] add run script --- run.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 run.sh diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..66ed1f2 --- /dev/null +++ b/run.sh @@ -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