-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_run.sh
executable file
·37 lines (28 loc) · 1.14 KB
/
docker_run.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
#!/bin/bash
cd /src
cp -rf /src/* /builder/
cd /builder
if grep -q "#include <json>" ./scripting/*.sp ; then
echo "Reference to sm_json detected."
echo "Installing sm_json..."
git clone https://github.com/clugg/sm-json
cp -r ./sm-json/addons/sourcemod/scripting/include/* ./addons/sourcemod/scripting/include
fi
if [ ! -f ./smbuild ]; then
echo -e "\nThe smbuild file is missing."
script_files=$(ls ./scripting/*.sp)
main_file=${script_files[0]}
plugin_name=$(basename $main_file .sp)
echo -e "Creating it automatically for: $plugin_name\n"
echo "Plugin(source='scripting/get5_eventapi.sp')" > ./smbuild
echo "Package(name='get5_eventapi'," >> ./smbuild
echo " filegroups={" >> ./smbuild
echo " '.': ['LICENSE', 'README.md']," >> ./smbuild
echo " }," >> ./smbuild
echo ")" >> ./smbuild
cat ./smbuild
fi
echo -e "\nBuilding the plugin..."
smbuilder --flags='-E'
cp -rf /builder/builds/* /out/
echo -e "\nPlugin successfully built! 🎉"