Created
March 24, 2025 06:04
-
-
Save rehannali/9b7066ad9d2ac2e22bfe949931f2bb3e to your computer and use it in GitHub Desktop.
xcode-warnings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TAGS="TODO:|FIXME:|WARNING:" | |
ERRORTAG="ERROR:" | |
OUTPUT=$(find "${SRCROOT}" -name "*.h" -or -name "*.m" -or -name "*.swift" \( -not -path "${SRCROOT}/Carthage/*" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/") | |
ECHO "$OUTPUT" | |
if [[ $OUTPUT == *" error: "* ]] | |
then | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment