From 9185358c58e2f6b846c54cb9ed434f0a5d62a3b2 Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Tue, 5 Sep 2023 23:10:18 +0200 Subject: [PATCH] Slightly better Linux launch script. --- distribution/files/launcher_linux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/distribution/files/launcher_linux.sh b/distribution/files/launcher_linux.sh index 379cf11..da00b09 100755 --- a/distribution/files/launcher_linux.sh +++ b/distribution/files/launcher_linux.sh @@ -8,7 +8,9 @@ if [ ! -x "$(command -v java)" ]; then fi # cd to the installation dir. -SCRIPT_DIR=$(dirname "$0") +# A good solution that can withstand symbolic links. +# https://stackoverflow.com/a/17744637/3802890 +SCRIPT_DIR="$(dirname "$(readlink -f -- "$0")")" cd "$SCRIPT_DIR" || exit 1 # Launch the app.