From ba69bc3c41f656a889bc6e912462a558d734adc7 Mon Sep 17 00:00:00 2001 From: Zwixx Date: Wed, 26 May 2021 17:05:26 +0200 Subject: [PATCH] Use full path to Gitblit directory in batch scripts In order to call the Windows batch scripts on the command line from a different folder, the path to the files in the Gitblit directory needs to be explicitly stated in the Java command. Otherwise the JAR files or data directory are not found as they would be searched in the current directory. --- src/main/distrib/win/gitblit-stop.cmd | 2 +- src/main/distrib/win/gitblit.cmd | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/distrib/win/gitblit-stop.cmd b/src/main/distrib/win/gitblit-stop.cmd index b6bebd8a..b2cdbc44 100644 --- a/src/main/distrib/win/gitblit-stop.cmd +++ b/src/main/distrib/win/gitblit-stop.cmd @@ -1 +1 @@ -@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --stop --baseFolder data %* +@java -cp "%~dp0gitblit.jar";"%~dp0ext\*" com.gitblit.GitBlitServer --stop %* diff --git a/src/main/distrib/win/gitblit.cmd b/src/main/distrib/win/gitblit.cmd index 6cd193dd..c02e3896 100644 --- a/src/main/distrib/win/gitblit.cmd +++ b/src/main/distrib/win/gitblit.cmd @@ -1 +1,8 @@ -@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --baseFolder data %* +@SETLOCAL + +@SET gbhome=%~dp0 +@SET gbhome=%gbhome:~0,-1% + +@java -cp "%gbhome%\gitblit.jar";"%gbhome%\ext\*" com.gitblit.GitBlitServer --baseFolder "%gbhome%\data" %* + +@ENDLOCAL -- 2.39.5