forked from TeamAOF/skylore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.ps1
34 lines (31 loc) · 861 Bytes
/
sync.ps1
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
# params and constants
. .\config.ps1
# example config
# # used for setting the rigth url to download from.
# $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.
$url = "https://github.com/" + $owner + "/" + $repo + ".git"
# code
if (Test-Path -Path .git) {
git reset --hard
git pull
git switch $branch
java -jar InstanceSync.jar
Copy-Item .\offlineMods\* .\mods
}
else {
git clone $url modpack
Move-Item modpack\* .
Move-Item modpack\.git .
Remove-Item modpack -Recurse
git reset --hard
git pull
git switch $branch
java -jar InstanceSync.jar
Copy-Item .\offlineMods\* .\mods
}
if (Test-Path -Path ./server.lock) {
Copy-Item .\serverMods\* .\mods
. .\server.lock
}