9020faafe119

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 31 Jan 2012 18:04:30 -0500
parents e207b5fdb092 (current diff) 57cb38f18a17 (diff)
children f8ba5ff8177c
branches/tags (none)
files

Changes

diff -r e207b5fdb092 -r 9020faafe119 bundled/bootstrap.sh
--- a/bundled/bootstrap.sh	Tue Jan 31 12:57:17 2012 -0500
+++ b/bundled/bootstrap.sh	Tue Jan 31 18:04:30 2012 -0500
@@ -1,4 +1,26 @@
 #!/usr/bin/env bash
 
+#Enforce variables must be set
+set -u
+
+#Check for dependencies on downloader programs
+which -s curl
+CURL_INSTALLED=$?
+which -s wget
+WGET_INSTALLED=$?
+
+#Enforce strict error checking for the rest of the script
+set -e
+
+URL='https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar?v=1311305402832'
+
 cd bundled
-wget http://www.minecraft.net/download/minecraft_server.jar?v=1311305402832 -O minecraft_server.jar
+
+if [ $WGET_INSTALLED -eq 0 ]; then
+    wget "$URL" -O minecraft_server.jar
+elif [ $CURL_INSTALLED -eq 0 ]; then
+    curl -o minecraft_server.jar "$URL"
+else
+    echo "No downloader found. Please download the following file in your browser and move it to the 'clojurecraft/bundled' folder: $URL"
+    exit 1
+fi