forked from ProxusDev/server-datapack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
25 lines (25 loc) · 789 Bytes
/
build.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
#!/bin/bash
# Simple build script to put everything in an archive ready to be loaded in
# your minecraft server
#
# check if zip is installed, else install
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' zip|grep "install ok installed")
echo Checking if zip is installed: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo "Zip is not installed. Installing now"
sudo apt-get --yes install zip
fi
# make out directory if it doesnt exist yet
if [ ! -d "out" ]; then
mkdir out
fi
# Remove posibble older zips
rm -f out/pack.zip
# zip everything up into a pack
zip -r out/pack.zip data pack.mcmeta
# check for errors
if [ $? -eq 0 ]; then
echo "Build complete, pack can be found in out/pack.zip"
else
echo "Some error occured. Check the lines above for what happened (permissions?)"
fi