-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.sh
executable file
·65 lines (48 loc) · 1.52 KB
/
setup.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
64
65
#!/bin/bash
# paperweight 1.3.11
PAPERWEIGHT_COMMIT=1756148
# TODO add uhc-paper versions
UHC_PAPER_COMMIT=7822b13
# clone repos to the directory at the same level as uhc-plugin
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
fail () {
echo $1
exit
}
resetDir () {
cd "$SCRIPT_DIR/../" || fail "Where did you call this?"
}
installPaperweight () {
resetDir
[ ! -d ./paperweight ] && git clone https://github.com/PaperMC/paperweight || echo "Paperweight already installed"
cd ./paperweight || fail "Paperweight did not clone properly"
git reset --hard $PAPERWEIGHT_COMMIT
gradle publishToMavenLocal
}
installUHCPaper () {
resetDir
[ ! -d ./uhc-paper ] && git clone https://github.com/gaseum-labs/uhc-paper || echo "UHC paper already installed"
cd ./uhc-paper || fail "UHC Paper did not clone properly"
git reset --hard $UHC_PAPER_COMMIT
gradle applyPatches
gradle createReobfPaperclipJar
gradle publishDevBundlePublicationToMavenLocal
}
copyServerJar () {
resetDir
cd ./uhc-paper || fail "uhc-paper not installed"
[ ! -d "$SCRIPT_DIR/run" ] && mkdir "$SCRIPT_DIR/run"
mv "./build/libs/paper-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar" "$SCRIPT_DIR/run/server.jar" || fail "uhc-paper not built"
}
if [ $# == 0 ]
then
installPaperweight
installUHCPaper
copyServerJar
else
[ $1 == "p" ] && installPaperweight ||\
[ $1 == "u" ] && installUHCPaper ||\
[ $1 == "c" ] && copyServerJar ||\
fail "Unknown argument, please use p, u, or c"
fi
echo "UHC Plugin successfully setup"