summaryrefslogtreecommitdiff
path: root/init.sh
blob: 877096958bffd721816673b0eb0af4f2c1331d3b (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash

export LANG=C
export GROUP=TMW2
export ALTER=evol

CMD="$1"
PROTO="git@gitlab.com:"
if [[ -z "${CMD}" ]]; then
    export CMD="default"
fi

STR=$(git remote -v|grep "https://")
if [[ -n "${STR}" ]]; then
    export PROTO="https://gitlab.com/"
fi

CLONECMD="git clone --origin upstream"
CLONE1="${CLONECMD} ${PROTO}${GROUP}"
CLONE2="${CLONECMD} ${PROTO}"
CLONEA="${CLONECMD} ${PROTO}${ALTER}"

if [[ "${CMD}" == "all" || "${CMD}" == "default" ]]; then
    ${CLONE1}/clientdata.git client-data
    ${CLONEA}/hercules.git server-code
    ${CLONE1}/serverdata.git server-data
    ${CLONE1}/evol-tools.git tools
    ${CLONE1}/evol-hercules.git server-code/src/evol
    cd server-code/src/evol ; git checkout tmw2 ; cd ../../..
    ${CLONEA}/evol-local.git server-local # Do this even serve any purpose?
    ${CLONE1}/Docs.git docs
    ${CLONE1}/Docs.wiki.git wiki
    ln -s server-code/src/evol server-plugin
elif [[ "${CMD}" == "server" ]]; then
    ${CLONEA}/hercules.git server-code
    ${CLONE1}/serverdata.git server-data
    ${CLONE1}/evol-hercules.git server-code/src/evol
    cd server-code/src/evol ; git checkout tmw2 ; cd ../../..
    ${CLONE1}/evol-tools.git tools
    ln -s server-code/src/evol server-plugin
elif [[ "${CMD}" == "client" ]]; then
    ${CLONE1}/clientdata.git client-data
    ${CLONE1}/evol-tools.git tools
elif [[ "${CMD}" == "music" ]]; then
    ${CLONE1}/evol-music.git music
elif [[ "${CMD}" == "local" ]]; then
    ${CLONEA}/evol-local.git server-local
    ${CLONEA}/hercules.git server-code
    ${CLONE1}/serverdata.git server-data
    ${CLONE1}/evol-hercules.git server-code/src/evol
    cd server-code/src/evol ; git checkout tmw2 ; cd ../../..
    ${CLONE1}/evol-tools.git tools
    ln -s server-code/src/evol server-plugin
elif [[ "${CMD}" == "tools" ]]; then
    ${CLONE1}/evol-tools.git tools
elif [[ "${CMD}" == "plugin" ]]; then
    ${CLONE1}/evol-hercules.git server-code/src/evol
    cd server-code/src/evol ; git checkout tmw2 ; cd ../../..
    ln -s server-code/src/evol server-plugin
elif [[ "${CMD}" == "docs" ]]; then
    ${CLONE1}/Docs.git docs
    ${CLONE1}/Docs.wiki.git wiki
elif [[ "${CMD}" == "manaplus" ]]; then
    ${CLONE2}manaplus/manaplus.git manaplus
elif [[ "${CMD}" == "media" ]]; then
    ${CLONE1}/art.git art
elif [[ "${CMD}" == "update" ]]; then
    ${CLONEA}/hercules.git server-code
    ${CLONE1}/evol-hercules.git server-code/src/evol
    cd server-code/src/evol ; git checkout tmw2 ; cd ../../..
    ln -s server-code/src/evol server-plugin
fi

if [[ "${CMD}" == "all" ]]; then
    ${CLONE1}/evol-music.git music
    ${CLONE2}manaplus/manaplus.git manaplus
fi