Replace 'egrep' with 'git grep' in testing script.

This commit is contained in:
Sergio Benitez 2017-12-27 20:29:36 -08:00
parent 9dc4c260f7
commit 0101d8bf3a

View File

@ -31,7 +31,7 @@ function check_versions_match() {
# Ensures there are no tabs in any file. # Ensures there are no tabs in any file.
function ensure_tab_free() { function ensure_tab_free() {
local tab=$(printf '\t') local tab=$(printf '\t')
local matches=$(grep -I -R "${tab}" "${ROOT_DIR}" | egrep -v '/target|/.git|LICENSE') local matches=$(git grep -E -I "${tab}" "${ROOT_DIR}" | egrep -v 'LICENSE')
if ! [ -z "${matches}" ]; then if ! [ -z "${matches}" ]; then
echo "Tab characters were found in the following:" echo "Tab characters were found in the following:"
echo "${matches}" echo "${matches}"
@ -41,7 +41,7 @@ function ensure_tab_free() {
# Ensures there are no files with trailing whitespace. # Ensures there are no files with trailing whitespace.
function ensure_trailing_whitespace_free() { function ensure_trailing_whitespace_free() {
local matches=$(egrep -I -R " +$" "${ROOT_DIR}" | egrep -v "/target|/.git") local matches=$(git grep -E -I "\s+$" "${ROOT_DIR}")
if ! [ -z "${matches}" ]; then if ! [ -z "${matches}" ]; then
echo "Trailing whitespace was found in the following:" echo "Trailing whitespace was found in the following:"
echo "${matches}" echo "${matches}"