@@ -123,7 +123,6 @@ jobs:
123
123
# If file ends with .ino, add it to the list of sketches
124
124
echo "Sketch found: $file"
125
125
sketches+="$file "
126
- continue
127
126
elif [[ $(basename $(dirname $file)) == "src" ]]; then
128
127
# If file is in a src directory, find all sketches in the parent/examples directory
129
128
echo "Library src file found: $file"
@@ -135,31 +134,30 @@ jobs:
135
134
# If file is in a example folder but it is not a sketch, find all sketches in the current directory
136
135
echo "File in example folder found: $file"
137
136
sketch=$(find $(dirname $file) -name *.ino)
138
- sketches+=$sketch
137
+ sketches+=" $sketch "
139
138
echo "Sketch in example folder: $sketch"
140
139
fi
141
140
echo ""
142
141
done
142
+ else
143
+ echo "Unhandled change triggered the build. This should not happen."
144
+ exit 1
145
+ fi
143
146
147
+ if [[ -n $sketches ]]; then
144
148
# Remove duplicates
145
149
sketches=$(echo $sketches | tr ' ' '\n' | sort | uniq)
146
- echo ""
147
- echo "Unique sketches: $sketches"
148
-
149
150
for sketch in $sketches; do
150
151
echo $sketch >> sketches_found.txt
151
152
chunks_count=$((chunks_count+1))
152
153
done
153
-
154
154
echo "Number of sketches found: $chunks_count"
155
- else
156
- echo "Unhandled change triggered the build. This should not happen."
157
- exit 1
158
- fi
155
+ echo "Sketches: $sketches"
159
156
160
- if [[ $chunks_count -gt ${{ env.MAX_CHUNKS }} ]]; then
161
- echo "Too many sketches found. Limiting to ${{ env.MAX_CHUNKS }} chunks."
162
- chunks_count=${{ env.MAX_CHUNKS }}
157
+ if [[ $chunks_count -gt ${{ env.MAX_CHUNKS }} ]]; then
158
+ echo "More sketches than the allowed number of chunks found. Limiting to ${{ env.MAX_CHUNKS }} chunks."
159
+ chunks_count=${{ env.MAX_CHUNKS }}
160
+ fi
163
161
fi
164
162
165
163
chunks='["0"'
0 commit comments