Skip to content

Commit

Permalink
Fix issue with unknow grep option for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Raleksan committed Oct 11, 2024
1 parent 9331a8a commit 4ed25f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions steps/report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ touch "${st_list}"
groups=()
while IFS='' read -r line; do
groups+=("$line")
done < <(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g' | sort -u || : ; echo "Ungrouped metrics")
done < <(grep -oE '\[.*\]' "${list}" | sed 's/[][]//g' | sort -u || : ; echo "Ungrouped metrics")
for idx in "${!groups[@]}"; do
if [ "$idx" -eq $(( ${#groups[@]} - 1 )) ]; then
group_metrics=$(grep -oP "^[^\[]*$" "${list}" || :)
group_metrics=$(grep -oE "^[^[]*$" "${list}" || :)
else
group_metrics=$(grep -oP ".*\[\b${groups[$idx]}\b\].*" "${list}" || :)
group_metrics=$(grep -oE ".*\b${groups[$idx]}\b.*" "${list}" || :)
fi
if [[ $(printf "%s\n" "${group_metrics[@]}" | grep -c "item") -eq 0 ]]; then continue; fi
printf "\\item %s\n" "${groups[$idx]}" >> "${st_list}"
Expand Down

0 comments on commit 4ed25f6

Please sign in to comment.