forked from TGX-Android/tdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupgrade.sh
More file actions
executable file
·35 lines (29 loc) · 813 Bytes
/
Copy pathupgrade.sh
File metadata and controls
executable file
·35 lines (29 loc) · 813 Bytes
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
33
34
35
#!/bin/bash
set -e
USERNAME=$1
PASSWORD=$2
SECONDS=0
pushd tdlib > /dev/null
REMOTE="https://${USERNAME}:${PASSWORD}@$(git remote get-url origin | cut -c 9-)"
git checkout main > /dev/null
git pull origin main > /dev/null
cd source/td
git checkout master > /dev/null
git pull origin master
cd ..
echo "Building..."
./rebuild.sh > /dev/null 2>&1
git add --all
echo "Build finished."
cd ..
TDLIB_COMMIT=$(cat version.txt | cut -c 1-7)
COMMIT_MSG="Upgrade TDLib to tdlib/td@${TDLIB_COMMIT} + Rebuild OpenSSL"
if [ "$SECONDS" -ge 60 ]; then
git commit -m "$COMMIT_MSG" -m "Built in $(expr $SECONDS / 60)m $(expr $SECONDS % 60)s"
elif [ "$SECONDS" -gt 0 ]; then
git commit -m "$COMMIT_MSG" -m "Built in ${SECONDS}s"
else
git commit -m "$COMMIT_MSG"
fi
git push "$REMOTE" > /dev/null 2>&1
popd > /dev/null