@@ -151,11 +151,6 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
151
151
152
152
echo " Sizes file = $sizes_file "
153
153
154
- # echo board,target and start of sketches to sizes_file json
155
- echo " { \" board\" : \" $fqbn \" ,
156
- \" target\" : \" $target \" ,
157
- \" sketches\" : [" >> " $sizes_file "
158
-
159
154
mkdir -p " $ARDUINO_CACHE_DIR "
160
155
for i in ` seq 0 $(( $len - 1 )) `
161
156
do
@@ -213,11 +208,6 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
213
208
\" ram_percentage\" : $ram_percentage
214
209
}
215
210
}," >> " $sizes_file "
216
- # if i is the last index of the loop, remove the last comma
217
- echo " Debug (sketch)- removing last comma from the last JSON object"
218
- if [ $i -eq $(( $len - 1 )) ]; then
219
- sed -i ' $ s/.$//' " $sizes_file "
220
- fi
221
211
222
212
elif [ -f " $ide_path /arduino-builder" ]; then
223
213
echo " Building $sketchname with arduino-builder and FQBN=$currfqbn "
@@ -252,11 +242,6 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
252
242
# $xtra_opts "${sketchdir}/${sketchname}.ino"
253
243
fi
254
244
done
255
-
256
- # echo end of sketches sizes_file json
257
- echo " ]}" >> " $sizes_file "
258
- # echo end of board sizes_file json
259
- echo " }," >> " $sizes_file "
260
245
261
246
unset fqbn
262
247
unset xtra_opts
@@ -394,6 +379,12 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
394
379
echo " Start Sketch: $start_num "
395
380
echo " End Sketch : $end_index "
396
381
382
+ sizes_file=" $GITHUB_WORKSPACE /cli_compile_$chunk_index .json"
383
+ # echo board,target and start of sketches to sizes_file json
384
+ echo " { \" board\" : \" $fqbn \" ,
385
+ \" target\" : \" $target \" ,
386
+ \" sketches\" : [" >> " $sizes_file "
387
+
397
388
local sketchnum=0
398
389
args+=" -ai $ide_path -au $user_path -i $chunk_index "
399
390
for sketch in $sketches ; do
@@ -412,6 +403,15 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
412
403
return $result
413
404
fi
414
405
done
406
+ echo " Debug (sketch)- removing last comma from the last JSON object"
407
+ if [ $i -eq $(( $len - 1 )) ]; then
408
+ sed -i ' $ s/.$//' " $sizes_file "
409
+ fi
410
+ # echo end of sketches sizes_file json
411
+ echo " ]}" >> " $sizes_file "
412
+ # echo end of board sizes_file json
413
+ echo " }," >> " $sizes_file "
414
+
415
415
return 0
416
416
}
417
417
0 commit comments