From bca1b02dc4c4dfe72ea97f634642ecdc0a179aa8 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 9 Jun 2022 18:55:21 -0700 Subject: [PATCH] [Git Hooks] Fix hook to ignore submodule projects Submodule projects are sometimes out of my control, so I shouldn't have to deal with team identifiers in projects that don't affect my build process in any meaningful way. The only way to deal with this would be to fork and modify every project I touch that contains this stuff. No. Signed-off-by: Christopher Snowhill --- .githooks/pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index b77189cc9..5c0015796 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,7 +1,7 @@ #!/bin/sh -MATCHES=$(grep -nR --include project.pbxproj -E "(DevelopmentTeam|DEVELOPMENT_TEAM) =" .) -COUNT=$(echo -n "$MATCHES\c" | grep -cvE '= ""') +MATCHES=$(git grep -n -E "(DevelopmentTeam|DEVELOPMENT_TEAM) =" .) +COUNT=$(echo -n "$MATCHES\c" | grep -cvE '(Shared.xcconfig|= "")') if [ $COUNT -ne 0 ]; then ERRORS=$(echo -n "$MATCHES\c" | grep -vE '= ""')