]> source.dussan.org Git - gitblit.git/commitdiff
Use full path to Gitblit directory in batch scripts
authorZwixx <zwiixx@googlemail.com>
Wed, 26 May 2021 15:05:26 +0000 (17:05 +0200)
committerFlorian Zschocke <florian.zschocke@devolo.de>
Wed, 21 Jul 2021 08:00:05 +0000 (10:00 +0200)
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
src/main/distrib/win/gitblit.cmd

index b6bebd8a38ef79daf1f1d7d5627edd8e23a3bac1..b2cdbc44b0725b4895c94001349e9219cc3338bb 100644 (file)
@@ -1 +1 @@
-@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --stop --baseFolder data %*\r
+@java -cp "%~dp0gitblit.jar";"%~dp0ext\*" com.gitblit.GitBlitServer --stop  %*\r
index 6cd193dd6c8b57d76a9d651eeea680aa9b930fac..c02e3896e5bb1fd621652db91dadd6597428ab6b 100644 (file)
@@ -1 +1,8 @@
-@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --baseFolder data %*\r
+@SETLOCAL\r
+\r
+@SET gbhome=%~dp0\r
+@SET gbhome=%gbhome:~0,-1%\r
+\r
+@java -cp "%gbhome%\gitblit.jar";"%gbhome%\ext\*" com.gitblit.GitBlitServer --baseFolder "%gbhome%\data" %*\r
+\r
+@ENDLOCAL\r