This is an automated email from the ASF dual-hosted git repository.

thenatog pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 11bad7b  NIFI-9631 - Enable cli.sh to be used with a symbolic link
11bad7b is described below

commit 11bad7b4edb9da66b88f0ddedba68703294a84c7
Author: David Stewart <[email protected]>
AuthorDate: Wed Jan 26 10:03:11 2022 +0000

    NIFI-9631 - Enable cli.sh to be used with a symbolic link
    
    Signed-off-by: Nathan Gough <[email protected]>
    
    This closes #5717.
---
 .../nifi-toolkit-assembly/src/main/resources/bin/cli.sh        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh 
b/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
index 9ba36d5..9a30dde 100644
--- a/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
+++ b/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
@@ -19,8 +19,14 @@
 
 # Script structure inspired from Apache Karaf and other Apache projects with 
similar startup approaches
 
-SCRIPT_DIR=$(dirname "$0")
-SCRIPT_NAME=$(basename "$0")
+SCRIPT_LINK=$(readlink $0 2> /dev/null)
+if test -z "$SCRIPT_LINK"; then
+    SCRIPT_DIR=$(dirname "$0")
+    SCRIPT_NAME=$(basename "$0")
+else
+    SCRIPT_DIR=$(dirname "$SCRIPT_LINK")
+    SCRIPT_NAME=$(basename "$SCRIPT_LINK")
+fi
 NIFI_TOOLKIT_HOME=$(cd "${SCRIPT_DIR}" && cd .. && pwd)
 PROGNAME=$(basename "$0")
 

Reply via email to