|
@@ -1,29 +1,29 @@
|
|
|
|
+set -e # stop on all errors
|
|
|
|
+
|
|
git submodule update --init --recursive
|
|
git submodule update --init --recursive
|
|
cd deltachat-ios/libraries/deltachat-core-rust
|
|
cd deltachat-ios/libraries/deltachat-core-rust
|
|
OLD=`git branch --show-current`
|
|
OLD=`git branch --show-current`
|
|
if [ $# -eq 0 ]; then
|
|
if [ $# -eq 0 ]; then
|
|
- echo "updates deltachat-core-rust submodule to last commit of a branch."
|
|
|
|
- echo "usage: ./scripts/update-core.sh BRANCH_NAME"
|
|
|
|
|
|
+ echo "updates deltachat-core-rust submodule to a tag or to last commit of a branch."
|
|
|
|
+ echo "usage: ./scripts/update-core.sh BRANCH_OR_TAG"
|
|
echo "current branch: $OLD"
|
|
echo "current branch: $OLD"
|
|
exit
|
|
exit
|
|
fi
|
|
fi
|
|
-BRANCH=$1
|
|
|
|
-
|
|
|
|
|
|
+NEW=$1
|
|
|
|
|
|
git fetch
|
|
git fetch
|
|
-git checkout $BRANCH
|
|
|
|
|
|
+git checkout $NEW
|
|
TEST=`git branch --show-current`
|
|
TEST=`git branch --show-current`
|
|
-if [ "$TEST" != "$BRANCH" ]; then
|
|
|
|
- echo "cannot select branch: $BRANCH"
|
|
|
|
- exit
|
|
|
|
|
|
+if [ "$TEST" == "$NEW" ]; then
|
|
|
|
+ git pull
|
|
fi
|
|
fi
|
|
-git pull
|
|
|
|
|
|
+
|
|
commitmsg=`git log -1 --pretty=%s`
|
|
commitmsg=`git log -1 --pretty=%s`
|
|
cd ../../..
|
|
cd ../../..
|
|
|
|
|
|
|
|
|
|
git add deltachat-ios/libraries/deltachat-core-rust
|
|
git add deltachat-ios/libraries/deltachat-core-rust
|
|
-git commit -m "update deltachat-core-rust to '$commitmsg' of branch '$BRANCH'"
|
|
|
|
-echo "old branch: $OLD, new branch: $BRANCH"
|
|
|
|
|
|
+git commit -m "update deltachat-core-rust to '$commitmsg' of '$NEW'"
|
|
|
|
+echo "old: $OLD, new: $NEW"
|
|
echo "changes are committed to local repo."
|
|
echo "changes are committed to local repo."
|
|
echo "use 'git push' to use them or 'git reset HEAD~1; git submodule update --recursive' to abort."
|
|
echo "use 'git push' to use them or 'git reset HEAD~1; git submodule update --recursive' to abort."
|