From 5fcdecf78f58b0d11bf0b73d9fe9b57f8f45ee22 Mon Sep 17 00:00:00 2001
From: Rashad Kanavath <rashad.kanavath@c-s.fr>
Date: Fri, 19 Jun 2015 08:53:50 +0200
Subject: [PATCH] COMP: chdir to script dir and then start otbcli

---
 CMake/otbcli_app.sh.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMake/otbcli_app.sh.in b/CMake/otbcli_app.sh.in
index f24399ea9e..ddad53620e 100644
--- a/CMake/otbcli_app.sh.in
+++ b/CMake/otbcli_app.sh.in
@@ -10,11 +10,13 @@ CURRENT_SCRIPT_DIR=`dirname $0`
 if [ -e $CURRENT_SCRIPT_DIR/otbcli ]
 then
   # Prefer using the launcher inside the script dir
-  OTB_CLI_LAUNCHER=$CURRENT_SCRIPT_DIR/otbcli
+  OTB_CLI_LAUNCHER=./otbcli
 else
   # Use the one from the PATH
   OTB_CLI_LAUNCHER=otbcli
 fi
 
+cd $CURRENT_SCRIPT_DIR
+
 # start the application
 $OTB_CLI_LAUNCHER @APPLICATION_NAME@ "$@"
-- 
GitLab