Skip to content

Commit f7a881e

Browse files
committed
webdemo - handle incorrectly named files
1 parent d8e59bb commit f7a881e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/ci/emscripten/examples_to_build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ for folder in "${folders[@]}"; do
6969
cp -r $thumb_gif "$out_folder/$parent_folder_name/$folder_name/"
7070
outThumbs+="$thumb_gif,"
7171
elif [ -e "$thumb_jpg" ]; then
72-
cp -r $thumb_jpg "$out_folder/$parent_folder_name/$folder_name/"
72+
cp -r $thumb_jpg "$out_folder/$parent_folder_name/$folder_name/"
7373
outThumbs+="$thumb_jpg,"
7474
else
75-
outThumbs+="of.png,"
75+
#try any image file
76+
first_file=$(find . -maxdepth 1 \( -name "*.gif" -o -name "*.png" -o -name "*.jpg" \) -print -quit)
77+
# Check if a file was found
78+
if [ -n "$first_file" ]; then
79+
outThumbs+="$first_file,"
80+
else
81+
#default file
82+
outThumbs+="of.png,"
83+
fi
7684
fi
7785

7886
outPaths+="$parent_folder_name/$folder_name,"

0 commit comments

Comments
 (0)