forked from TeamAOF/skylore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.sh
35 lines (33 loc) · 766 Bytes
/
sync.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
#!/bin/bash
source ./config.sh
# example config
# #!/bin/bash
# owner="TeamAOF" # creator of the git repository.
# repo="skylore" # name of the git repository.
# branch="indev" # branch of the git repository. for examle main or master.
repoExists=$(git rev-parse --is-inside-work-tree)
url="https://github.com/${owner}/${repo}.git"
# code
git config pull.rebase false
if [ "$repoExists" ]
then
git reset --hard
git pull
git switch "$branch"
java -jar InstanceSync.jar
cp -a offlineMods/. mods
else
git clone "$url" modpack
cp -a modpack/. .
rm -r -f modpack
git reset --hard
git pull
git checkout "$branch"
java -jar InstanceSync.jar
cp -a offlineMods/. mods
fi
if [ -f "server.lock" ]
then
cp -a serverMods/. mods
bash server.lock
fi