Skip to content

Commit 7999f08

Browse files
committed
fix(regex): Trim argument before grep
1 parent 7cdca56 commit 7999f08

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +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+
requirement=$(echo $requirement | xargs)
103104
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
104105
if [[ "$found_line" == "" ]]; then
105106
continue 2
@@ -190,6 +191,7 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
190191
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
191192
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
192193
for requirement in $requirements; do
194+
requirement=$(echo $requirement | xargs)
193195
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
194196
if [[ "$found_line" == "" ]]; then
195197
continue 2

Diff for: .github/scripts/sketch_utils.sh

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
161161
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
162162
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
163163
for requirement in $requirements; do
164+
requirement=$(echo $requirement | xargs)
164165
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
165166
if [[ "$found_line" == "" ]]; then
166167
echo "Target $target does not meet the requirement $requirement for $sketchname. Skipping."
@@ -317,6 +318,7 @@ function count_sketches(){ # count_sketches <path> [target] [file]
317318
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
318319
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
319320
for requirement in $requirements; do
321+
requirement=$(echo $requirement | xargs)
320322
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
321323
if [[ "$found_line" == "" ]]; then
322324
continue 2

Diff for: .github/scripts/tests_run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function run_test() {
4444
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
4545
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
4646
for requirement in $requirements; do
47+
requirement=$(echo $requirement | xargs)
4748
found_line=$(grep -E "^$requirement" "$SDKCONFIG_PATH")
4849
if [[ "$found_line" == "" ]]; then
4950
printf "\033[93mTarget $target does not meet the requirement $requirement for $sketchname. Skipping.\033[0m\n"

0 commit comments

Comments
 (0)