-
-
Save gaeng2y/317864cc8394f251b1ca2afbf1f5fa6e to your computer and use it in GitHub Desktop.
Xcode behavior 용: pod init 하기
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/bash | |
# move project dir | |
PROJECT_HOME=`pwd` | |
echo "cd $PROJECT_HOME" > /tmp/tmp.sh | |
# search .xcodeproj file and strip filename | |
PROJECT_NAME="" | |
for f in *.xcodeproj; do | |
PROJECT_NAME="${f%.*}" | |
break | |
done | |
if [[ -z "$PROJECT_NAME" ]] || [ "$PROJECT_NAME" == "*" ]; then | |
osascript -e 'tell application (path to frontmost application as text) to display dialog "Cannot find project file" buttons {"OK"} with icon stop' | |
exit | |
fi | |
# pod init & update | |
echo "pod init" >> /tmp/tmp.sh | |
echo "pod install" >> /tmp/tmp.sh | |
echo "clear" >> /tmp/tmp.sh | |
# reload workspace file | |
echo "echo \"Close '$PROJECT_NAME' Xcode window\"" >> /tmp/tmp.sh | |
echo "echo" >> /tmp/tmp.sh | |
echo "read -p \"Press enter to continue...\"" >> /tmp/tmp.sh | |
echo "open $PROJECT_NAME.xcworkspace" >> /tmp/tmp.sh | |
chmod +x /tmp/tmp.sh | |
open -a Terminal /tmp/tmp.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment