Skip to content

Commit

Permalink
tools: fix check repositories script for macs (envoyproxy#4914)
Browse files Browse the repository at this point in the history
Fix check_repositories script when running on a mac. The version of grep that comes as part of OSX does not support the -P flag. This will instead utilize git grep to pattern match.

Risk Level: Low
Testing: Manually ran the script on my machine. See attached output below.
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Derek Schaller <[email protected]>
  • Loading branch information
dschaller authored and htuch committed Oct 31, 2018
1 parent b46199b commit 5d7218b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/check_repositories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fi

# Check whether number of defined `url =` or `urls =` and `sha256 =` kwargs in
# repository definitions is equal.
urls_count=$(grep -IPnrs "url(s)? =" --include=*.bzl . | wc -l)
sha256sums_count=$(grep -nr "sha256 =" --include=*.bzl . | wc -l)
urls_count=$(git grep -E "url(s)? =" -- '*.bzl' | wc -l)
sha256sums_count=$(git grep -E "sha256 =" -- '*.bzl' | wc -l)

if [[ $urls_count != $sha256sums_count ]]; then
echo "Found more defined repository URLs than SHA256 sums, which means that there are some repositories without sums."
Expand Down

0 comments on commit 5d7218b

Please sign in to comment.