Skip to content

Commit 3ad865c

Browse files
committed
script cleanup
1 parent bb56db6 commit 3ad865c

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

tools/ci/install-arduino-ide.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ function build_sketches() # build_sketches <examples-path> <fqbn> <chunk> <total
146146
count_sketches "$examples"
147147
local sketchcount=$?
148148
local sketches=$(cat sketches.txt)
149+
rm -rf sketches.txt
149150

150151
local chunk_size=$(( $sketchcount / $chunks_num ))
151152
local all_chunks=$(( $chunks_num * $chunk_size ))
@@ -176,21 +177,13 @@ function build_sketches() # build_sketches <examples-path> <fqbn> <chunk> <total
176177
local sketchdir=$(dirname $sketch)
177178
local sketchdirname=$(basename $sketchdir)
178179
local sketchname=$(basename $sketch)
179-
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
180-
#echo "Skipping $sketch, beacause it is not the main sketch file";
181-
continue
182-
fi;
183-
if [[ -f "$sketchdir/.test.skip" ]]; then
184-
#echo "Skipping $sketch marked";
180+
if [ "${sketchdirname}.ino" != "$sketchname" ] \
181+
|| [ -f "$sketchdir/.test.skip" ]; then
185182
continue
186183
fi
187184
sketchnum=$(($sketchnum + 1))
188-
if [ "$sketchnum" -le "$start_index" ]; then
189-
#echo "Skipping $sketch index low"
190-
continue
191-
fi
192-
if [ "$sketchnum" -gt "$end_index" ]; then
193-
#echo "Skipping $sketch index high"
185+
if [ "$sketchnum" -le "$start_index" ] \
186+
|| [ "$sketchnum" -gt "$end_index" ]; then
194187
continue
195188
fi
196189
build_sketch "$fqbn" "$sketch" "$xtra_opts"

tools/ci/install-platformio-esp32.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ function build_pio_sketches() # build_pio_sketches <examples-path> <board> <chun
7171
local board=$2
7272
local chunk_idex=$3
7373
local chunks_num=$4
74-
local xtra_opts=$5
7574

7675
if [ "$chunks_num" -le 0 ]; then
7776
echo "ERROR: Chunks count must be positive number"
@@ -85,6 +84,7 @@ function build_pio_sketches() # build_pio_sketches <examples-path> <board> <chun
8584
count_sketches "$examples"
8685
local sketchcount=$?
8786
local sketches=$(cat sketches.txt)
87+
rm -rf sketches.txt
8888

8989
local chunk_size=$(( $sketchcount / $chunks_num ))
9090
local all_chunks=$(( $chunks_num * $chunk_size ))
@@ -115,21 +115,13 @@ function build_pio_sketches() # build_pio_sketches <examples-path> <board> <chun
115115
local sketchdir=$(dirname $sketch)
116116
local sketchdirname=$(basename $sketchdir)
117117
local sketchname=$(basename $sketch)
118-
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
119-
#echo "Skipping $sketch, beacause it is not the main sketch file";
120-
continue
121-
fi;
122-
if [[ -f "$sketchdir/.test.skip" ]]; then
123-
#echo "Skipping $sketch marked";
118+
if [ "${sketchdirname}.ino" != "$sketchname" ] \
119+
|| [ -f "$sketchdir/.test.skip" ]; then
124120
continue
125121
fi
126122
sketchnum=$(($sketchnum + 1))
127-
if [ "$sketchnum" -le "$start_index" ]; then
128-
#echo "Skipping $sketch index low"
129-
continue
130-
fi
131-
if [ "$sketchnum" -gt "$end_index" ]; then
132-
#echo "Skipping $sketch index high"
123+
if [ "$sketchnum" -le "$start_index" ] \
124+
|| [ "$sketchnum" -gt "$end_index" ]; then
133125
continue
134126
fi
135127
build_pio_sketch "$board" "$sketch"

tools/ci/on-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ else
5151
python -m platformio ci --board esp32dev libraries/BLE/examples/BLE_server && \
5252
python -m platformio ci --board esp32dev libraries/AzureIoT/examples/GetStarted && \
5353
python -m platformio ci --board esp32dev libraries/ESP32/examples/Camera/CameraWebServer --project-option="board_build.partitions = huge_app.csv"
54-
#build_pio_sketches libraries "esp32dev" "$CHUNK_INDEX" "$CHUNKS_CNT"
54+
#build_pio_sketches libraries esp32dev $CHUNK_INDEX $CHUNKS_CNT
5555
if [ $? -ne 0 ]; then exit 1; fi
5656
fi

0 commit comments

Comments
 (0)