forked from euroelessar/qutim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-repository.sh
executable file
·63 lines (54 loc) · 1.04 KB
/
init-repository.sh
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
#!/bin/bash
# Argument = --help --developer
usage()
{
cat << EOF
usage: $0 options
This script init qutIM repo
OPTIONS:
-h Show this message
-d Init with upstream repos for merge requests
EOF
}
add_upstream_repo()
{
local repo_path=$1
local repo_url=$2
local root=$PDW
echo "--Add upstream ${repo_url} for ${repo_path}"
cd $repo_path
git remote add upstream $repo_url &> /dev/null
cd $root
}
init_repository()
{
git submodule update --init --recursive
}
init_developer()
{
echo "--Adding upstream remote repos for easy development"
local root=$PWD
add_upstream_repo $root git://github.com/euroelessar/qutim.git
add_upstream_repo $root/protocols/jabber/jreen git://github.com/euroelessar/jreen.git
add_upstream_repo $root/protocols/vkontakte/vreen git://github.com/gorthauer/vreen.git
}
dflag=false
while getopts “hd” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
d)
dflag=true
;;
?)
exit
;;
esac
done
init_repository
if $dflag ; then
init_developer
fi