|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" |
| 3 | +if [ -d "$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" ]; then |
| 4 | + SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" |
| 5 | +elif [ -d "$GITHUB_WORKSPACE/tools/esp32-arduino-libs" ]; then |
| 6 | + SDKCONFIG_DIR="$GITHUB_WORKSPACE/tools/esp32-arduino-libs" |
| 7 | +else |
| 8 | + SDKCONFIG_DIR="tools/esp32-arduino-libs" |
| 9 | +fi |
4 | 10 |
|
5 | 11 | function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [extra-options]
|
6 | 12 | while [ ! -z "$1" ]; do
|
@@ -278,10 +284,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
278 | 284 | unset options
|
279 | 285 | }
|
280 | 286 |
|
281 |
| -function count_sketches(){ # count_sketches <path> [target] [file] |
| 287 | +function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requirements] |
282 | 288 | local path=$1
|
283 | 289 | local target=$2
|
284 | 290 | local file=$3
|
| 291 | + local ignore_requirements=$4 |
285 | 292 |
|
286 | 293 | if [ $# -lt 1 ]; then
|
287 | 294 | echo "ERROR: Illegal number of parameters"
|
@@ -314,16 +321,18 @@ function count_sketches(){ # count_sketches <path> [target] [file]
|
314 | 321 | continue
|
315 | 322 | fi
|
316 | 323 |
|
317 |
| - # Check if the sketch requires any configuration options |
318 |
| - requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json) |
319 |
| - if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then |
320 |
| - for requirement in $requirements; do |
321 |
| - requirement=$(echo $requirement | xargs) |
322 |
| - found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig) |
323 |
| - if [[ "$found_line" == "" ]]; then |
324 |
| - continue 2 |
325 |
| - fi |
326 |
| - done |
| 324 | + if [[ "$ignore_requirements" != "1" ]]; then |
| 325 | + # Check if the sketch requires any configuration options |
| 326 | + requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json) |
| 327 | + if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then |
| 328 | + for requirement in $requirements; do |
| 329 | + requirement=$(echo $requirement | xargs) |
| 330 | + found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig) |
| 331 | + if [[ "$found_line" == "" ]]; then |
| 332 | + continue 2 |
| 333 | + fi |
| 334 | + done |
| 335 | + fi |
327 | 336 | fi
|
328 | 337 | fi
|
329 | 338 | echo $sketch >> sketches.txt
|
|
0 commit comments