File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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 ,"
You can’t perform that action at this time.
0 commit comments