summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZwixx <zwiixx@googlemail.com>2021-05-26 17:05:26 +0200
committerFlorian Zschocke <florian.zschocke@devolo.de>2021-07-21 10:00:05 +0200
commitba69bc3c41f656a889bc6e912462a558d734adc7 (patch)
tree3edccfb0b841838cbb2040dbfedacd71a2fd258e /src
parentb50628d5cf317b07b40c67a049b527837661b934 (diff)
downloadgitblit-ba69bc3c41f656a889bc6e912462a558d734adc7.tar.gz
gitblit-ba69bc3c41f656a889bc6e912462a558d734adc7.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/main/distrib/win/gitblit-stop.cmd2
-rw-r--r--src/main/distrib/win/gitblit.cmd9
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