Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Find all print statements] Used as run script build phase #Xcode #Swift
#!/bin/bash
SEARCH='print\(.*'
echo "Searching ${SRCROOT} for ${SEARCH}"
find "${SRCROOT}" \( -name "*.swift" \) -not -path "${SRCROOT}/Pods/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($SEARCH).*\$" | perl -p -e "s/($SEARCH)/ warning: Print Violation (use logger instead): \$1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment