File size: 797 Bytes
f871013
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash

set -e # stop on all errors

git submodule update --init --recursive
cd jni/deltachat-core-rust
OLD=`git branch --show-current`
if [ $# -eq 0 ]; then
    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"
    exit
fi
NEW=$1

git fetch
git checkout $NEW
TEST=`git branch --show-current`
if [ "$TEST" == "$NEW" ]; then
    git pull
fi

commitmsg=`git log -1 --pretty=%s`
cd ../..


git add jni/deltachat-core-rust
git commit -m "update deltachat-core-rust to '$commitmsg' of '$NEW'"
echo "old: $OLD, new: $NEW"
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."