Skip to content

Commit 66e74ed

Browse files
committed
fix(json): Ignore comments when searching requirements
1 parent 795c436 commit 66e74ed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function count_sketches(){ # count_sketches <examples-path>
100100
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
101101
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
102102
for requirement in $requirements; do
103-
found_line=$(grep "$requirement" $LIBS_DIR/esp32/sdkconfig)
103+
found_line=$(grep "^$requirement" $LIBS_DIR/esp32/sdkconfig)
104104
if [[ "$found_line" == "" ]]; then
105105
continue 2
106106
fi
@@ -190,7 +190,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
190190
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
191191
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
192192
for requirement in $requirements; do
193-
found_line=$(grep "$requirement" $LIBS_DIR/esp32/sdkconfig)
193+
found_line=$(grep "^$requirement" $LIBS_DIR/esp32/sdkconfig)
194194
if [[ "$found_line" == "" ]]; then
195195
continue 2
196196
fi

.github/scripts/sketch_utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
154154
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
155155
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
156156
for requirement in $requirements; do
157-
found_line=$(grep "$requirement" $LIBS_DIR/$target/sdkconfig)
157+
found_line=$(grep "^$requirement" $LIBS_DIR/$target/sdkconfig)
158158
if [[ "$found_line" == "" ]]; then
159159
echo "Target $target does not meet the requirement $requirement for $sketchname. Skipping."
160160
exit 0
@@ -310,7 +310,7 @@ function count_sketches(){ # count_sketches <path> [target] [file]
310310
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
311311
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
312312
for requirement in $requirements; do
313-
found_line=$(grep "$requirement" $LIBS_DIR/$target/sdkconfig)
313+
found_line=$(grep "^$requirement" $LIBS_DIR/$target/sdkconfig)
314314
if [[ "$found_line" == "" ]]; then
315315
continue 2
316316
fi

.github/scripts/tests_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function run_test() {
2525
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
2626
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
2727
for requirement in $requirements; do
28-
found_line=$(grep "$requirement" $LIBS_DIR/$target/sdkconfig)
28+
found_line=$(grep "^$requirement" $LIBS_DIR/$target/sdkconfig)
2929
if [[ "$found_line" == "" ]]; then
3030
printf "\033[93mTarget $target does not meet the requirement $requirement for $sketchname. Skipping.\033[0m\n"
3131
printf "\n\n\n"

0 commit comments

Comments
 (0)