Last active
March 18, 2024 09:26
-
-
Save iletai/dd8ec855d5d8de81174231502df6e274 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/bash | |
current_branch=$(git branch --show-current) | |
stash_name="$(date +%Y-%b-%d/%H-%M-%S)/$current_branch_name" | |
git fetch origin $current_branch | |
cd "$1" | |
if [ -f "Podfile.lock" ]; then | |
echo "" | |
echo -e "=> Podfile.lock exists! Reset Lock File\n" | |
git checkout HEAD -- Podfile.lock | |
else | |
echo -e "=> Podfile.lock does not exist\n" | |
fi | |
git stash --include-untracked -m "$stash_name" | |
echo -e "=> START PULL BRANCH: $current_branch...!\n" | |
git pull origin $current_branch | |
export LANG=en_US.UTF-8 | |
if [ -f "Podfile" ]; then | |
echo -e "START POD UPDATE\n" | |
pod update | |
else | |
echo -e "=> POD FILE NOT EXIST! \n" | |
fi | |
# Please Stash Dummy Login Infomation And Save It To SourceTree. | |
# With name {$"fastlogin"} | |
stashes=`git stash list | grep "fastlogin"` | |
if [ "$stashes" ]; then | |
echo "You have the following stashes for this branch: ${stashes}" | |
# git stash apply $stashes => Bug shellscript sync mutil version stash. | |
git stash apply stash^{/fastlogin} | |
fi | |
PROJECT=$(find . -maxdepth 1 -name "*.xcworkspace" | head -n 1) | |
if [[ -z "$PROJECT" ]]; then | |
echo -e "=> No XCode Project Found!\n" | |
exit 1 | |
else | |
echo -e "=> Open Repo in XCode: $PROJECT !\n" | |
open "$PROJECT" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SourceTree custom script to save time with:
.xcworkspace