From 00235aef5970c7850af4bd780281c4b3e755bcc6 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Thu, 4 Jan 2024 10:54:38 -0300 Subject: [PATCH] Try to get folders inside script --- scripts/docker/run-c.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/docker/run-c.sh b/scripts/docker/run-c.sh index 351acbba..33aa144a 100755 --- a/scripts/docker/run-c.sh +++ b/scripts/docker/run-c.sh @@ -6,11 +6,13 @@ echo echo "C" echo -for folder in $FOLDERS; do +FOLDERS=$(find . -name 'problem.md' | sed 's/problem.md//g' | sort) + +for folder in ${FOLDERS}; do [ -f "${folder}WRONG" ] && continue - if [ "$(find "$folder" -name '*.c' | wc -l)" -eq 1 ]; then - echo "$folder" + if [[ "$(find "$folder" -name '*.c' | wc -l)" -eq 1 ]]; then + echo "$folder" cd "$folder" || exit 1 gcc -Werror -std=c99 -O2 -lm ./*.c