Generate warning for TODO and FIXME in Xcode with Cocoapods

I was trying to generate a warning in Xcode if there is one in my project TODO:

or FIXME:

using the following bash script from HERE :

TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"

      

How I used CocoaPods, is it possible to search only for my project and its testing, but not in Pods?

EDIT: update the sample code for .swift compatibility

TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"

      

+3


source to share


1 answer


Try changing the line:

find "${SRCROOT}"

...



include the forward slash and your project name after the end of the curly brace. For example, if your application was called by SaxGuy, it would look like this:

find "${SRCROOT}/SaxGuy"

...

+4


source







All Articles