Skip to content

Commit 469a163

Browse files
authored
Update build.sh
1 parent ae1a68f commit 469a163

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

SupportFiles/build.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PROJECT_PATH="$(dirname "$(PWD)")"
99
# PARAMS TO CHANGE
1010
#
1111

12+
BRANCH='master'
13+
1214
COMPANY='my_company'
1315
GAME_NAME='new_game'
1416
BUNDLE='com.mygames.game'
@@ -50,6 +52,19 @@ UNITY='/Applications/Unity/Hub/Editor/2019.3.0f1/Unity.app/Contents/MacOS/Unity'
5052
[ -d "$IOS_DEVELOPMENT" ] || mkdir "$IOS_DEVELOPMENT"
5153
[ -d "$IOS_RELEASE" ] || mkdir "$IOS_RELEASE"
5254

55+
function UpdateRepo {
56+
echo ''
57+
echo "update branch $BRANCH..."
58+
echo ''
59+
git fetch > "$LOGS_PATH/git.log" 2>&1
60+
git reset --hard HEAD >> "$LOGS_PATH/git.log" 2>&1
61+
git checkout $BRANCH >> "$LOGS_PATH/git.log" 2>&1
62+
git pull >> "$LOGS_PATH/git.log" 2>&1
63+
echo ''
64+
echo "$BRANCH updated"
65+
echo ''
66+
}
67+
5368
function SendTelegramMessage {
5469
curl $BOT_PROXY https://api.telegram.org/bot$BOT_TOKEN/sendMessage -m 60 -s -X POST -d chat_id=$CHAT_ID -d text="$1" > "$LOGS_PATH/bot.log" 2>&1
5570
}
@@ -286,6 +301,8 @@ echo '|||||||||||||||||||||||||||||||'
286301
echo ''
287302
echo ''
288303
echo ''
304+
echo "0 – Update branch $BRANCH"
305+
echo ''
289306
echo '1 – Run tests'
290307
echo ''
291308
echo '2 – Android development'
@@ -309,6 +326,9 @@ exit 1
309326
fi
310327
clear
311328
case $key in
329+
0)
330+
UpdateRepo
331+
;;
312332
1)
313333
Tests
314334
;;
@@ -357,4 +377,4 @@ echo ''
357377
exit 1
358378
;;
359379
esac
360-
ShowElapsedTime
380+
ShowElapsedTime

0 commit comments

Comments
 (0)