diff --git a/bin/run-klaw.bat b/bin/run-klaw.bat index 7662621f88..80b5cbe9c9 100644 --- a/bin/run-klaw.bat +++ b/bin/run-klaw.bat @@ -1,4 +1,9 @@ @echo off + +SET CURRENTDIR="%cd%" +set DIR=%~dp0..\ +cd %DIR% + set version=2.6.0 set core_lib=.\core\target\klaw-%version%.jar set cluster_lib=.\cluster-api\target\cluster-api-%version%.jar @@ -8,14 +13,11 @@ set core_log_file=core.log set clusterapi_log_file=cluster-api.log echo Starting Klaw servers .. - echo ---------- Klaw Core ---------- - if not exist "%core_lib%" ( echo %core_lib% doesn't exist. Exiting .. exit /b 1 ) - tasklist /FI "IMAGENAME eq java.exe" 2>NUL | find /I "core" >NUL if %errorlevel% equ 0 ( echo Core is already running @@ -26,12 +28,10 @@ if %errorlevel% equ 0 ( ) echo ---------- Klaw Cluster api ---------- - if not exist "%cluster_lib%" ( echo %cluster_lib% doesn't exist. Exiting .. exit /b 1 ) - tasklist /FI "IMAGENAME eq java.exe" 2>NUL | find /I "cluster-api" >NUL if %errorlevel% equ 0 ( echo Cluster-api is already running @@ -40,5 +40,5 @@ if %errorlevel% equ 0 ( start /B java -jar %cluster_lib% --spring.config.location=%cluster_config% > %clusterapi_log_file% tasklist /FI "IMAGENAME eq java.exe" 2>NUL | find /I "cluster-api" >NUL ) - -echo Logging to %core_log_file% %clusterapi_log_file% +cd %CURRENTDIR% +echo Logging to %core_log_file% %clusterapi_log_file% \ No newline at end of file diff --git a/bin/run-klaw.sh b/bin/run-klaw.sh index 52573987ba..2e45b838b7 100644 --- a/bin/run-klaw.sh +++ b/bin/run-klaw.sh @@ -1,5 +1,8 @@ #!/bin/bash +WORKING_DIR="$(dirname "$0")"/.. +cd $WORKING_DIR + # Declarations version=2.6.0 core_lib=./core/target/klaw-${version}.jar