From 584d2e700d2910ffb8c879f12811b6e5725f084a Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Wed, 19 Oct 2016 23:17:30 +0200 Subject: [PATCH] KEYCLOAK-3740 kcreg.sh doesn't support symlinking --- .../src/main/bin/kcreg.sh | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/integration/client-cli/client-registration-cli/src/main/bin/kcreg.sh b/integration/client-cli/client-registration-cli/src/main/bin/kcreg.sh index 2684c77663..5d37a77569 100755 --- a/integration/client-cli/client-registration-cli/src/main/bin/kcreg.sh +++ b/integration/client-cli/client-registration-cli/src/main/bin/kcreg.sh @@ -1,3 +1,21 @@ #!/bin/sh -DIRNAME=`dirname "$0"` -java $KC_OPTS -cp $DIRNAME/client/keycloak-client-registration-cli-${project.version}.jar org.keycloak.client.registration.cli.KcRegMain "$@" +RESOLVED_NAME="$0" +case "`uname`" in + CYGWIN*) + CFILE = `cygpath "$0"` + RESOLVED_NAME=`readlink -f "$CFILE"` + ;; + Darwin*) + RESOLVED_NAME=`readlink "$0"` + ;; + FreeBSD) + RESOLVED_NAME=`readlink -f "$0"` + ;; + Linux) + RESOLVED_NAME=`readlink -f "$0"` + ;; +esac + +DIRNAME=`dirname "$RESOLVED_NAME"` + +java $KC_OPTS -cp $DIRNAME/client/keycloak-client-registration-cli-${project.version}.jar org.keycloak.client.registration.cli.KcRegMain "$@" \ No newline at end of file