From: Zwixx Date: Wed, 26 May 2021 15:05:26 +0000 (+0200) Subject: Use full path to Gitblit directory in batch scripts X-Git-Tag: v1.9.2~29^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ba69bc3c41f656a889bc6e912462a558d734adc7;p=gitblit.git 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. --- 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