Skip to content

Commit 481b682

Browse files
committed
fix
1 parent c649cf7 commit 481b682

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/scripts/install-platformio-esp32.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
149149
continue
150150
fi
151151

152-
if ! ${CHECK_REQUIREMENTS} $sketchdir "$SDKCONFIG_DIR/esp32/sdkconfig"; then
152+
if [ ${CHECK_REQUIREMENTS} $sketchdir "$SDKCONFIG_DIR/esp32/sdkconfig" -eq 0 ]; then
153153
continue
154154
fi
155155
fi

.github/scripts/sketch_utils.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ function check_requirements(){ # check_requirements <sketchdir> <sdkconfig_path>
1212
local sketchdir=$1
1313
local sdkconfig_path=$2
1414

15+
if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then
16+
echo "ERROR: sdkconfig or ci.json not found"
17+
exit 1
18+
fi
19+
1520
# Check if the sketch requires any configuration options (AND)
1621
local requirements=$(jq -r '.requires[]? // empty' "$sketchdir/ci.json")
1722
if [[ "$requirements" != "null" && "$requirements" != "" ]]; then
1823
for requirement in $requirements; do
1924
requirement=$(echo $requirement | xargs)
2025
found_line=$(grep -E "^$requirement" "$sdkconfig_path")
2126
if [[ "$found_line" == "" ]]; then
22-
return 0
27+
echo 0
2328
fi
2429
done
2530
fi
@@ -37,11 +42,11 @@ function check_requirements(){ # check_requirements <sketchdir> <sdkconfig_path>
3742
fi
3843
done
3944
if [[ "$found" == "false" ]]; then
40-
return 0
45+
echo 0
4146
fi
4247
fi
4348

44-
return 1
49+
echo 1
4550
}
4651

4752
function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [extra-options]
@@ -207,7 +212,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
207212
exit 0
208213
fi
209214

210-
if ! check_requirements "$sketchdir" "$SDKCONFIG_DIR/$target/sdkconfig"; then
215+
if [ $(check_requirements "$sketchdir" "$SDKCONFIG_DIR/$target/sdkconfig") -eq 0 ]; then
211216
echo "Target $target does not meet the requirements for $sketchname. Skipping."
212217
exit 0
213218
fi
@@ -358,7 +363,7 @@ function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requi
358363
fi
359364

360365
if [ "$ignore_requirements" != "1" ]; then
361-
if ! check_requirements "$sketchdir" "$SDKCONFIG_DIR/$target/sdkconfig"; then
366+
if [ $(check_requirements "$sketchdir" "$SDKCONFIG_DIR/$target/sdkconfig") -eq 0 ]; then
362367
continue
363368
fi
364369
fi

.github/scripts/tests_run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function run_test() {
3737
return 0
3838
fi
3939

40-
if ! ${CHECK_REQUIREMENTS} $sketchdir $sdkconfig_path; then
40+
if [ ${CHECK_REQUIREMENTS} $sketchdir "$sdkconfig_path" -eq 0 ]; then
4141
printf "\033[93mTarget $target does not meet the requirements for $sketchname. Skipping.\033[0m\n"
4242
printf "\n\n\n"
4343
return 0

0 commit comments

Comments
 (0)