This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
publish.sh
83 lines (66 loc) · 2.62 KB
/
publish.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
########################
AMXX_SCRIPTING_PATH=""
OUTPUT_DIR="_PUBLISH"
RELEASE_NAME="ReZP_publish"
AMXMODX="1.9"
########################
COMPILER_PATH=".compiler"
if [ ! -d ${COMPILER_PATH} ]; then
TEMPDIR="./.temp"
mkdir ${TEMPDIR}
AMXX_FILENAME=$(curl https://www.amxmodx.org/amxxdrop/${AMXMODX}/amxmodx-latest-base-linux)
curl -s https://www.amxmodx.org/amxxdrop/${AMXMODX}/${AMXX_FILENAME} | tar -xz -C ${TEMPDIR}
AMXX_FILENAME=$(curl https://www.amxmodx.org/amxxdrop/${AMXMODX}/amxmodx-latest-base-windows)
curl https://www.amxmodx.org/amxxdrop/${AMXMODX}/${AMXX_FILENAME} -o amxmodx.zip
unzip -o amxmodx.zip -d ${TEMPDIR}
rm amxmodx.zip
curl -OL https://github.com/s1lentq/reapi/releases/download/5.19.0.211/reapi_5.19.0.211-dev.zip
unzip -o reapi_*-dev.zip -d ${TEMPDIR}
rm reapi_*-dev.zip
rm -rf ${TEMPDIR}/addons/amxmodx/scripting/testsuite/
rm -rf ${TEMPDIR}/addons/amxmodx/scripting/*.sma
rm -rf ${TEMPDIR}/addons/amxmodx/plugins/*.amxx
mkdir -p ${COMPILER_PATH}
mv -f ${TEMPDIR}/addons/amxmodx/scripting/* ${COMPILER_PATH}
rm -rf ${TEMPDIR}
echo -e "\n=========================\n > Compiler ${AMXX_FILENAME} and ReAPI succefully downloaded!"
else
echo -e "\n=========================\n > Compiler found at: ${COMPILER_PATH} path"
fi
AMXX_SCRIPTING_PATH=${COMPILER_PATH}
amxxpc="${AMXX_SCRIPTING_PATH}/amxxpc"
case "$OSTYPE" in
msys*) amxxpc="${amxxpc}.exe" ;;
*) echo "unknown: $OSTYPE" ;;
esac
function realpath {
echo $(cd $(dirname $1); pwd)/$(basename $1);
}
amxxpc=$(realpath ${amxxpc})
# Create dir
rm -rf ${OUTPUT_DIR} && mkdir ${OUTPUT_DIR}
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/api
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/addons
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/player
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/gamemodes
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/items
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/menus
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/weapons
mkdir -p ${OUTPUT_DIR}/addons/amxmodx/plugins/rezombieplague/configs
scripting_dir=${OUTPUT_DIR}/addons/amxmodx/scripting
cp -rp rezombieplague ${scripting_dir}
cp -rp extra/* ${OUTPUT_DIR}
# Compile
cd ${scripting_dir}
echo " > Current dir=${scripting_dir}"
echo " > amxxpc path=${amxxpc}"
find * -name "*.sma" \
-exec echo -e "\n\n> Compile {} <" \;\
-exec ${amxxpc} {} \
-iinclude \
-o../plugins/{} \
\;
# Pack to release
cd ../../../
tar -czpf ${RELEASE_NAME}.tar.gz *