-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·45 lines (34 loc) · 1.18 KB
/
build
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
#!/bin/bash
BUILDPATH=$(pwd)/PSACBuild
GITHUB_URL=https://github.com/peyang-Celeron/PeyangSuperbAntiCheat
# Colored output
ESC=$(printf '\033')
RESET="${ESC}[0m"
BOLD="${ESC}[1m"
RED="${ESC}[31m"
YELLOW="${ESC}[33m"
GREEN="${ESC}[32m"
if type "git" > /dev/null 2>&1; then
git clone --depth 1 --recursive "$GITHUB_URL" "PSACBuild"
elif type "curl" > /dev/null 2>&1 || type "wget" > /dev/null 2>&1; then
tarball="https://github.com/peyang-Celeron/PeyangSuperbAntiCheat/archive/master.tar.gz"
if type "curl" > /dev/null 2>&1; then
curl -L "$tarball"
elif type "wget" > /dev/null 2>&1; then
wget -O - "$tarball"
fi | tar zx
mv -f PeyangSuperbAntiCheat-master "PSACBuild"
else
echo "${RED}${BOLD}ERROR${RESET}: ${BOLD}curl${RESET} or ${BOLD}wget${RESET} required"
exit 1
fi
cd "$(pwd)/PSACBuild" || echo "${RED}${BOLD}ERROR${RESET}: ${BOLD}$BUILDPATH not found${RESET}" || exit 1
# Build
if type "mvn" > /dev/null 2>&1; then
mvn package && \
echo "${GREEN}${BOLD}SUCCESS${RESET}: PeyangSuperbAntiCheat build completed successfly." && \
exit 0
echo "${RED}${BOLD}ERROR${RESET}: ${BOLD}Unknown error occured"
else
echo "${RED}${BOLD}ERROR${RESET}: ${BOLD}maven${RESET} required"
fi