summaryrefslogtreecommitdiff
path: root/get_version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'get_version.sh')
-rwxr-xr-xget_version.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/get_version.sh b/get_version.sh
index cae7101..c413459 100755
--- a/get_version.sh
+++ b/get_version.sh
@@ -1,5 +1,28 @@
#!/usr/bin/env sh
+# Check for packages
+JQ_VERSION=$(jq --version 2>/dev/null)
+if [[ ${JQ_VERSION} == 'jq-1.3' || ${JQ_VERSION} == 'jq-1.4' || ${JQ_VERSION} == 'jq-1.5' || ${JQ_VERSION} == 'jq-1.6' ]]; then
+ echo 'ERROR: installed jq version is too old; must be at least 1.7'
+ exit 1
+elif [ -z ${JQ_VERSION} ]; then
+ echo 'ERROR: please install jq 1.7+'
+ exit 1
+fi
+
+NICKLE_LOCATION=$(which nickle)
+CURL_LOCATION=$(which curl)
+
+if [ ! -f "${NICKLE_LOCATION}" ]; then
+ echo "ERROR: please install Nickle"
+ exit 1
+fi
+
+if [ ! -f "${CURL_LOCATION}" ]; then
+ echo "ERROR: please install cURL"
+ exit 1
+fi
+
# Only accepts 1 argument: the Minecraft version to download
LOOOKING_FOR=
if [ -z "${1}" ]; then