Fix for `--version` when `.git` is missing
#!/bin/bash
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+# Output should be empty if git isn't available; the output gets baked into the
+# jar file and checked in the application code.
+if ! command -v git &>/dev/null ; then
+ exit
+fi
+
+if [ ! -d "$SCRIPTS_DIR/../.git" ]; then
+ exit
+fi
+
RELEASE_TAG=$("$SCRIPTS_DIR/newest-release-tag.sh")
MERGE_BASE=$(git merge-base "$RELEASE_TAG" HEAD)
