Created
December 23, 2015 21:05
-
-
Save bubudrc/d387d6c16ed522805d3d to your computer and use it in GitHub Desktop.
SNIPPETS - Script to use on Xcode
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
# HIGHLIGHT YOUR TODOS, FIXMES, & ERRORS IN XCODE | |
TAGS="TODO:|FIXME:" | |
ERRORTAG="ERROR:" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -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/" | |
# ------------------------------------------ | |
# CHANGE BUILD VERSION | |
# This splits a two-decimal version string, such as "0.45.123", allowing us to increment the third position. | |
# Dont forget to change the number on BUIL input (Target -> General -> Build) | |
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
NEWSUBVERSION=`echo $VERSIONNUM | awk -F "." '{print $3}'` | |
NEWSUBVERSION=$(($NEWSUBVERSION + 1)) | |
NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $NEWVERSIONSTRING" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment