summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Sneed <gary@getcobalt.org>2024-10-25 21:40:39 -0700
committerGary Sneed <gary@getcobalt.org>2024-10-25 21:40:39 -0700
commite38c87eab91ba6dfa1c8ac0d3096fbb7fb2d0e6e (patch)
tree926d2fac328aaa651feff3994f4722bc92a6bb7d
parent77bfeea29daa4fa8315e839a7f22bc342f675320 (diff)
Added dependency checksv1.1
-rw-r--r--README.md2
-rwxr-xr-xget_version.sh23
2 files changed, 24 insertions, 1 deletions
diff --git a/README.md b/README.md
index 4f6937c..eb8cdf9 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ The other options for Minecraft launchers are massive (e.g. MultiMC) and like ma
- OpenBSD
## Dependencies
-* `jq`, `curl` and `nickle` - On Debian, you can install with `sudo apt install jq curl nickle`.
+* `jq` (1.7 and later), `curl` and `nickle` - On Debian, you can install with `sudo apt install curl nickle` and get `jq` from here: https://jqlang.github.io/jq/download/ - The version of `jq` shipped with a lot of distributions is apparently very old; you need 1.7 and later.
* `uname`, `xargs`, `ls`, `cat`, `tr`, `mkdir`, `tee`, `dirname`, `sha1sum`, `sed`, `basename`, `date`, `xargs` - Listed for good measure, but you should almost certainly have all of these unless you are using an incomplete distribution/operating system.
* A POSIX-compatible shell - If you are on Linux or a UNIX-based operating system, you almost certainly have one.
* A Java runtime - Check with your distribution for installing. On Debian-based systems, the package is usually `default-jre` or `openjdk-<version>-jre`.
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