From 4fdb9c2e37f819c4e5bf681fa4693e7665518b36 Mon Sep 17 00:00:00 2001 From: heineh Date: Sun, 12 May 2024 21:30:15 +0200 Subject: [PATCH] Added ESCAPED_JAVA_CMD so that JAVA_CMD='C:\java\jdk-17.0.8+7\bin\java' ./bin/start-client works in git-bash. --- .gitignore | 1 + bin/start-client | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7fd4394..32ad3a0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ client .clj-kondo/ .lsp/ server/.nrepl-port +.calva/ diff --git a/bin/start-client b/bin/start-client index 9d19cfc..0824169 100755 --- a/bin/start-client +++ b/bin/start-client @@ -48,6 +48,9 @@ fi printf "\033[32m[start-client]\033[0m GUI wird gestartet. Das dauert einen Augenblick ....\n" +## Taken from https://stackoverflow.com/a/2705678 +ESCAPED_JAVA_CMD=$(printf '%s\n' "${JAVA_CMD}" | sed -e 's/[\/&]/\\&/g') + clojure -A:launcher-api -M -e ' (do (require (quote [lambdaisland.witchcraft.launcher-api :as l]) @@ -66,4 +69,4 @@ clojure -A:launcher-api -M -e ' (l/launcher-backend "client") (l/session {:username "'"$1"'" :session-id "x" :uuid (str (random-uuid))}) "'"$MC_VERSION"'"))) -' | sed "s^java^${JAVA_CMD}^" | sh +' | sed "s^java^'${ESCAPED_JAVA_CMD}'^" | sh