-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpatchrom.sh
More file actions
executable file
·66 lines (57 loc) · 1.48 KB
/
patchrom.sh
File metadata and controls
executable file
·66 lines (57 loc) · 1.48 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Micode:patchrom sync tool by kqstone (kqstone@163.com)
# Please use "sh patchrom.sh [option]" to execute this tool
# [option] nothing for help
# init: initiate workspace
# sync: sync patchrom jellybean branch code
PULL="git pull origin jellybean"
git_init_project() {
for n in 1 2 3 4; do
eval arg_temp=\$$n
echo "===========init patchrom_${arg_temp}=========="
mkdir ${arg_temp}
cd ${arg_temp}
git init
URL_TEMP="git@github.com:MiCode/patchrom_"${arg_temp}".git"
git remote add origin $URL_TEMP
cd ..
done
}
git_pull() {
# git pull function
echo ">>>>git pull started"
$PULL
while [ $? -ne 0 ]; do
echo ">>>>>>git pull failed, pull again"
$PULL
done
}
git_pull_project() {
for n in 1 2 3 4; do
eval arg_temp=\$$n
echo "===========sync patchrom_${arg_temp}=========="
cd $arg_temp
git_pull
cd ..
done
}
if [ -z "$1" ]; then
echo "========================================================="
echo "Micode:patchrom sync tool by kqstone (kqstone@163.com)"
echo 'Please use "sh patchrom.sh [option]" to execute this tool'
echo "[option] nothing for help"
echo " init: initiate workspace"
echo " sync: sync patchrom jellybean branch code"
echo "========================================================="
exit 0
fi
if [ "$1" = "init" ]; then
cd ..
git_init_project "tools" "android" "miui" "build"
exit 0
fi
if [ "$1" = "sync" ]; then
cd ..
git_pull_project "tools" "android" "miui" "build"
exit 0
fi