# HG changeset patch # User Eliot # Date 1315643747 25200 # Node ID 57cb38f18a1710baf2bd2a7eb42f395040d37cef # Parent 7942222da83080b6757e56a9fdefc72e9619ecc1 Better bootstrap.sh script. It now checks for dependencies and supports downloading via either wget or curl. It also prints a message on how to download the file manually in case neither utility is found. Update URL to use new download location. diff -r 7942222da830 -r 57cb38f18a17 bundled/bootstrap.sh --- a/bundled/bootstrap.sh Fri Sep 02 20:10:35 2011 -0400 +++ b/bundled/bootstrap.sh Sat Sep 10 01:35:47 2011 -0700 @@ -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