Skip to content

Commit 7d28e63

Browse files
committed
fix(grep): Trim strings before grep
1 parent 7cdca56 commit 7d28e63

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: .github/scripts/install-platformio-esp32.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function count_sketches(){ # count_sketches <examples-path>
9797
fi
9898

9999
# Check if the sketch requires any configuration options
100-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
100+
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json | xargs)
101101
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
102102
for requirement in $requirements; do
103103
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
@@ -187,7 +187,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
187187
fi
188188

189189
# Check if the sketch requires any configuration options
190-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
190+
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json | xargs)
191191
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
192192
for requirement in $requirements; do
193193
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")

Diff for: .github/scripts/sketch_utils.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
158158
fi
159159

160160
# Check if the sketch requires any configuration options
161-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
161+
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json | xargs)
162162
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
163163
for requirement in $requirements; do
164164
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
@@ -314,7 +314,7 @@ function count_sketches(){ # count_sketches <path> [target] [file]
314314
fi
315315

316316
# Check if the sketch requires any configuration options
317-
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
317+
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json | xargs)
318318
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
319319
for requirement in $requirements; do
320320
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)

0 commit comments

Comments
 (0)