Created
August 23, 2013 19:31
-
-
Save segiddins/6323076 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
# ~/bin/repod | |
set -e | |
if [ ! -e Podfile ]; then | |
echo "Podfile not found" >&2 | |
exit 1 | |
fi | |
if [ -z "$1" ]; then | |
echo "Missing pod to reinstall" >&2 | |
exit 1 | |
fi | |
unpod() { | |
if ! grep -qs "$1" Podfile; then | |
echo "Pod $1 not found in Podfile" >&2 | |
exit 1 | |
fi | |
sed -i '' "s%pod.*$1.*%#&%g" Podfile | |
} | |
ununpod() { | |
if ! grep -qs "$1" Podfile; then | |
echo "Pod $1 not found in Podfile" >&2 | |
exit 1 | |
fi | |
sed -i '' "s%^#*\(pod.*$1.*\)$%\1%g" Podfile | |
} | |
for POD in "$@"; do | |
unpod "$POD" | |
done | |
pod | |
for POD in "$@"; do | |
ununpod "$POD" | |
done | |
pod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment