From f81ce7d78f7f5a6e16b11e953562ade88ff7b4d0 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Tue, 7 Jul 2015 11:50:20 +0200
Subject: [PATCH] BACKOUT 18149: changing directory makes relative paths wrong

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

diff --git a/CMake/otbcli_app.sh.in b/CMake/otbcli_app.sh.in
index ddad53620e..f24399ea9e 100644
--- a/CMake/otbcli_app.sh.in
+++ b/CMake/otbcli_app.sh.in
@@ -10,13 +10,11 @@ CURRENT_SCRIPT_DIR=`dirname $0`
 if [ -e $CURRENT_SCRIPT_DIR/otbcli ]
 then
   # Prefer using the launcher inside the script dir
-  OTB_CLI_LAUNCHER=./otbcli
+  OTB_CLI_LAUNCHER=$CURRENT_SCRIPT_DIR/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