summaryrefslogtreecommitdiff
path: root/utils/bin
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-08-13 12:11:18 +0200
committerGitHub <[email protected]>2021-08-13 12:11:18 +0200
commit988c74ec5665250c572dcc6bae018ed0ea180c25 (patch)
tree747556740d360482fc0edfc7ce5ce996bbbca06a /utils/bin
parent6bbce4ee07ac8428846dfb6722e15a932d6d9e05 (diff)
feat: Add pre-commit hook for linting and formatting (#1132)
* feat: Add pre-commit hook for linting and formatting * format with prettier
Diffstat (limited to 'utils/bin')
-rwxr-xr-xutils/bin/jdtls10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/bin/jdtls b/utils/bin/jdtls
index 2b0f226a..961d2df5 100755
--- a/utils/bin/jdtls
+++ b/utils/bin/jdtls
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+# shellcheck disable=SC2116
# NOTE:
# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead
@@ -7,7 +8,8 @@
# If you're not using Linux you'll need to adjust the `-configuration` option
# to point to the `config_mac' or `config_win` folders depending on your system.
-case Darwin in
+OS="$(uname -s)"
+case "$OS" in
Linux)
CONFIG="$HOME/.local/share/nvim/lspinstall/java/config_linux"
;;
@@ -32,7 +34,7 @@ location of your Java installation."
fi
else
JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ command -v java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
@@ -46,10 +48,10 @@ GRADLE_HOME=$HOME/gradle "$JAVACMD" \
-Declipse.product=org.eclipse.jdt.ls.core.product \
-Dlog.protocol=true \
-Dlog.level=ALL \
- -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \
+ -javaagent:"$HOME/.local/share/nvim/lspinstall/java/lombok.jar" \
-Xms1g \
-Xmx2G \
- -jar $(echo "$JAR") \
+ -jar "$(echo "$JAR")" \
-configuration "$CONFIG" \
-data "${1:-$HOME/workspace}" \
--add-modules=ALL-SYSTEM \