aboutsummaryrefslogtreecommitdiff
path: root/tests/prepare.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-03-09 09:32:23 +0100
committerKarel Kočí <cynerd@email.cz>2016-03-09 09:32:23 +0100
commita149a27041e90674f34228e7ef1b05b6f1a61ca5 (patch)
tree0fd156a4646ef09ed7cffa24a482e002d4ddfff3 /tests/prepare.sh
parentec37e36a622614ac233d986911889bac1e59fc46 (diff)
downloadmcserver-wrapper-a149a27041e90674f34228e7ef1b05b6f1a61ca5.tar.gz
mcserver-wrapper-a149a27041e90674f34228e7ef1b05b6f1a61ca5.tar.bz2
mcserver-wrapper-a149a27041e90674f34228e7ef1b05b6f1a61ca5.zip
Add Travis test
For beginning only coding standards are check. In future should be tested at least basic features.
Diffstat (limited to 'tests/prepare.sh')
-rwxr-xr-xtests/prepare.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/prepare.sh b/tests/prepare.sh
new file mode 100755
index 0000000..d8248b4
--- /dev/null
+++ b/tests/prepare.sh
@@ -0,0 +1,30 @@
+#~/bin/bash
+if [[ "$(basename -- "$0")" = "prepare.sh" ]]; then
+ echo "Please only source this script"
+ exit 1
+fi
+
+# Write basic configuration
+cp ../example.conf mcwrapper.conf
+
+if [[ $PREPARED != "y" ]]; then
+ # Move to known directory
+ cd "$( dirname "${BASH_SOURCE[0]}" )"
+
+ if [[ $MCSERVERS == "y" ]]; then
+ mkdir -p minecraft-server
+ echo "eula=true" > minecraft-server/eula.txt
+ # Get Minecraft 1.8.8
+ [ -f minecraft-server/minecraft_server.1.8.8.jar ] || \
+ wget https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar -O minecraft-server/minecraft_server.1.8.8.jar
+ # Get Minecraft 1.9
+ [ -f minecraft-server/minecraft_server.1.9.jar ] || \
+ wget https://s3.amazonaws.com/Minecraft.Download/versions/1.9/minecraft_server.1.9.jar -O minecraft-server/minecraft_server.1.9.jar
+ function mcservers_clean {
+ find minecraft-server | tail -n +2 | egrep -v "minecraft_server.*jar" | egrep -v "eula.txt" | xargs rm -rf
+ }
+ fi
+
+ export PATH=$( realpath .. ):$PATH
+ export PREPARED="y"
+fi