update-core.sh 819 B

1234567891011121314151617181920212223242526272829
  1. set -e # stop on all errors
  2. git submodule update --init --recursive
  3. cd deltachat-ios/libraries/deltachat-core-rust
  4. OLD=`git branch --show-current`
  5. if [ $# -eq 0 ]; then
  6. echo "updates deltachat-core-rust submodule to a tag or to last commit of a branch."
  7. echo "usage: ./scripts/update-core.sh BRANCH_OR_TAG"
  8. echo "current branch: $OLD"
  9. exit
  10. fi
  11. NEW=$1
  12. git fetch
  13. git checkout $NEW
  14. TEST=`git branch --show-current`
  15. if [ "$TEST" == "$NEW" ]; then
  16. git pull
  17. fi
  18. commitmsg=`git log -1 --pretty=%s`
  19. cd ../../..
  20. git add deltachat-ios/libraries/deltachat-core-rust
  21. git commit -m "update deltachat-core-rust to '$commitmsg' of '$NEW'"
  22. echo "old: $OLD, new: $NEW"
  23. echo "changes are committed to local repo."
  24. echo "use 'git push' to use them or 'git reset HEAD~1; git submodule update --recursive' to abort."